Connect to the PhotoGPT API and send authenticated requests.
Getting Started
Use the PhotoGPT Developer API to manage models, upload image assets, start image or video generation jobs, and retrieve generated media.
Base URL
https://developer.photogptai.com/apiAll endpoint paths in these docs are relative to this base URL.
Authentication
Every request must include a bearer API key and API version header.
const API_KEY = '<YOUR_API_KEY>'
const BASE_URL = 'https://developer.photogptai.com/api'
const headers = {
Authorization: `Bearer ${API_KEY}`,
'API-Version': '1',
}import requests
API_KEY = "<YOUR_API_KEY>"
BASE_URL = "https://developer.photogptai.com/api"
headers = {
"Authorization": f"Bearer {API_KEY}",
"API-Version": "1",
}First request
Run a health check before testing model or generation workflows.
const response = await fetch(`${BASE_URL}/ping`, {
headers,
})
if (!response.ok) {
throw new Error(await response.text())
}
console.log(await response.json())response = requests.get(f"{BASE_URL}/ping", headers=headers)
response.raise_for_status()
print(response.json())Expected response:
{
"message": "pong!",
"status": "OK"
}Response shape
Most successful API responses return useful data in result and include a top-level
status.
const response = await fetch(`${BASE_URL}/models`, {
headers,
})
if (!response.ok) {
throw new Error(await response.text())
}
const body = await response.json()
const models = body.resultresponse = requests.get(f"{BASE_URL}/models", headers=headers)
response.raise_for_status()
models = response.json()["result"]Error responses include status: "NOK" and may include message, err, and result.
How the API fits together
Verify connectivity
Confirm your API key, headers, and base URL are valid.
Understand jobs
Poll long-running generation jobs and read completed outputs.
Run an end-to-end workflow
Create a model, train it, generate images, upscale, adapt, and create video.
Prepare a model
Create or update the model resource used by training and generation.
Upload images
Upload training images or auxiliary reference images.
Generate images
Start image generation with trained models or public image models.
Generate videos
Start video generation, inspect videos, and create download links.
Full endpoint list
Use the API Reference for generated request/response schemas, interactive parameter controls, and endpoint-level examples.