Creative Lab API overview
Create image, video and audio tasks through a single Creative Lab API. The model catalog lists each model’s result type, supported parameters and input file roles.
Features
Section titled “Features”Use POST /api/v2/media/tasks to create a task for any model. The machine-readable schema from GET /api/v2/media/models describes model-specific parameters, so you can add models without changing the integration.
Additional features include a price quote before generation (POST /api/v2/media/price), an idempotency key for safe retries, webhook delivery, and optional short synchronous waiting (wait).
Base URL
Section titled “Base URL”https://gptunnel.ru/api/v2/mediaSend your API key in the Authorization header with or without the Bearer prefix.
Authorization: YOUR_API_KEYHow it works
Section titled “How it works”- (Optional) List models and their parameters with
GET /api/v2/media/models. - (Optional) Get an estimate with
POST /api/v2/media/price. - Create a task with
POST /api/v2/media/tasks. The response contains a task object with itsidand status. - Get the result using one of these options.
- Poll
GET /api/v2/media/tasks/:iduntil the status isdoneorfailed. - Pass
webhook_urlwhen creating the task. GPTunneL sends a notification when the task finishes. - Pass
wait: truewhen creating the task. If the status is stillqueuedorrunningafter the wait, poll using the sameid.
- Poll
Status of the task
Section titled “Status of the task”| Status | Meaning |
|---|---|
queued |
Task accepted and waiting to run |
running |
Generation is in progress |
done |
Generation finished. See the links in result. |
failed |
Generation failed. See error for details. |
What happens if the model is removed from service?
Section titled “What happens if the model is removed from service?”If a retired model has a designated replacement, tasks run on the replacement at the originally requested model’s rate. Without a replacement, task creation returns 410 with code: 21. See the model catalog for retirement dates and replacements, and Deprecated models for how to detect a replacement.
Sections
Section titled “Sections”- Model catalog —
GET /media/models - Calculation of price —
POST /media/price - Creation of the task —
POST /media/tasks - Getting a Task —
GET /media/tasks/:id - Webhooks — Delivering the result and verifying the signature
- Error Directory