Requests
Request states, polling, safe retries, and failures.
A model run can take seconds or minutes. Submit a request and poll for its result.
Statuses
| Status | Meaning |
|---|---|
preparing | Input files are being fetched and checked. |
queued | Waiting for the model. |
running | The model is working. |
succeeded | output.files contains the result and cost_usd contains the charge. |
failed | See error for the cause. Nothing is charged. A request that did not start within 15 minutes fails with queue_timeout. |
Media requests cannot be cancelled once submitted. Use POST /v1/responses/{id}/cancel to cancel a background chat response. Recover or cancel a chat response
Polling
Read GET /v1/request/{id} every 2 to 5 seconds until the status is succeeded or failed. Reads have their own, high limit (see Limits), so polling never blocks your submits.
For chat, a succeeded request exposes the stored answer in output.message.content when retention allows it. The OpenAI-compatible retrieval routes are GET /v1/chat/completions/{id} and GET /v1/responses/{id}. Use the same workspace and service account that started the request.
Retries without double runs
Send an Idempotency-Key header on every submit you may retry (a network error, a timeout, a 5xx):
curl -X POST https://platform-api.invideo.io/v1/request \
-H "Authorization: Bearer $INVIDEO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1234-thumbnail" \
-d '{"model": "nano-banana-2-1", "mode": "generate", "input": {"prompt": "a cup of coffee"}}'The same key (1 to 255 characters, per workspace) never starts a second run: it answers with the first request.
Failures
A failed run answers 200 with status: "failed" and an error:
{
"status": "failed",
"error": { "type": "content", "code": "...", "message": "...", "retryable": false }
}type | Meaning |
|---|---|
content | The model refused the prompt or the input. Change it. |
input | An input file or value did not work for this model. |
model | The model failed. retryable: true means try again later. |
server | Our side failed. Try again. |
Output files
output.files[] has url, content_type, size_bytes, and width, height, duration when they apply. A url works for one hour and is signed again on every read: download the file, or read the request again for a new link.