Skip to content

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.

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).

https://gptunnel.ru/api/v2/media

Send your API key in the Authorization header with or without the Bearer prefix.

Authorization: YOUR_API_KEY
  1. (Optional) List models and their parameters with GET /api/v2/media/models.
  2. (Optional) Get an estimate with POST /api/v2/media/price.
  3. Create a task with POST /api/v2/media/tasks. The response contains a task object with its id and status.
  4. Get the result using one of these options.
    • Poll GET /api/v2/media/tasks/:id until the status is done or failed.
    • Pass webhook_url when creating the task. GPTunneL sends a notification when the task finishes.
    • Pass wait: true when creating the task. If the status is still queued or running after the wait, poll using the same id.
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.