Docs menuinvideo Platform docsQuickstartFor AI agentsAPI referenceAuthenticationRequestsFilesErrorsLimitsBilling and balanceCatalogueProvider keys (BYOK)Formats and model IDsChat completionsOpenAI ResponsesAnthropic MessagesGeminiStreaming chat answersTools (function calling)Structured output (JSON)VideoAudioUse your own SDKOpenAI mediaElevenLabsReplicatefalGemini mediaxAIRunwayLumaDeepgram and CartesiaMakers' own APIsVideo provider formatsImage provider formatsAudio provider formatsLLM provider formatsGenerate and edit imagesTest your integrationWorkspaces and membersSecurityService accountsModels
View as markdown

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

StatusMeaning
preparingInput files are being fetched and checked.
queuedWaiting for the model.
runningThe model is working.
succeededoutput.files contains the result and cost_usd contains the charge.
failedSee 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):

bash
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:

json
{
  "status": "failed",
  "error": { "type": "content", "code": "...", "message": "...", "retryable": false }
}
typeMeaning
contentThe model refused the prompt or the input. Change it.
inputAn input file or value did not work for this model.
modelThe model failed. retryable: true means try again later.
serverOur 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.