Quickstart
Create and poll a GPT Image 2 task with a complete working request.
Authentication
Create an API key, check account access, and send credentials safely.
Image models
Browse image-generation and image-editing models with their exact request schemas.
Video models
Browse text, image, and reference-driven video generation models.
What you can build
Image and video calls are deliberately asynchronous: the create response acknowledges the task, and a later status response delivers the generated asset.
Media task workflow
Choose the endpoint that matches the generated asset, then open the exact model page before building the request:- Image tasks use
/v1/images/generationsand/v1/images/status/{task_id}. - Video tasks use
/v1/videos/generationsand/v1/videos/status/{task_id}. - Model pages define the accepted prompt, media inputs, aspect ratio, duration, resolution, and other model-specific fields.
- Webhooks can deliver terminal task events when continuous polling is not practical.
A request lifecycle that matches APIPod
- Authenticate. Send
Authorization: Bearer <API_KEY>from a server-side environment.GET /v1/account/statusis a lightweight credential and account probe. - Discover. Browse the image and video groups in the API Reference or use the Models link in the header to open the live product catalog.
- Select the contract. Use the model ID exactly as documented, then validate against that page’s OpenAPI panel. A model’s fields and limits can differ from another model in the same family.
- Execute. Create an image or video task with an
Idempotency-Keyand persist the returnedtask_id. - Complete. Poll
GET /v1/images/status/{task_id}orGET /v1/videos/status/{task_id}, or configure a webhook for terminal task events. - Persist and observe. Store output assets in durable storage and log
task_id,X-Request-ID, HTTP status, and machine-readable error codes.
A successful media create response means that APIPod accepted the task. It does not mean that generation has completed. Treat
pending and processing as non-terminal states and stop only at completed, failed, or cancelled.Production checklist
- Keep API keys on your backend, outside source control and browser bundles.
- Retry only when the operation is safe to retry. For an ambiguous media create request, reuse the same
Idempotency-Keyand unchanged JSON body. - Use bounded exponential backoff with jitter for polling and transient
429,503, or5xxresponses. - Persist
task_idbefore background polling and copy result URLs to storage you control. - Branch on the response status before reading
resultor error fields; preserve unknown machine codes for forward compatibility. - Use webhooks when continuous polling is not practical, and error handling for retry and failure semantics.
Async tasks
Polling, terminal states, and result delivery for media generation.
API reference
Model-specific schemas and runnable cURL, Python, Go, Rust, and JavaScript examples.
Pricing estimate
Review pricing and estimate a request before spending quota.