Skip to main content
SnapGen returns errors in the OpenAI-compatible envelope.
Use the HTTP status code together with error.type and error.code to decide how to recover.

Video request error

A video request with a duration unsupported by the selected model can return a 400 invalid_request error. Gemini Omni models require "10"; Seedance 2 models accept "5", "10", or "15".
The response has error.type and error.code set to invalid_request. Set the duration required by your selected model and submit the request again.

Retry safely

Retry only errors that can be temporary, such as 429 and 5xx responses. Do not retry an invalid key, an unavailable model, or an empty balance without changing the request or account state.
Log the HTTP status, request ID when present, and the complete error object. Do not log API keys or sensitive prompt content.