Errors
Every HTTP status and error code the Cheapest Imagen API returns, what each one means, whether it was charged and what to do next.
Errors have the same shape as OpenAI's:
{
"error": {
"message": "Not enough credits for this request.",
"type": "invalid_request_error",
"param": null,
"code": "insufficient_credits"
}
}Every response carries an x-request-id header. Include it when you contact support.
| Status | code | Meaning | What to do |
|---|---|---|---|
| 400 | missing_required_parameter | A required field is missing | Add the field named in param |
| 400 | invalid_value | A field has a value that is not accepted | Fix the field named in param |
| 400 | unsupported_parameter | The field is not available, or not on this model (for example svg on a model without SVG output) | Remove the field or pick a model that has it |
| 400 | model_not_found | The model does not exist or is not open | Use a model from GET /v1/models |
| 400 | moderation_blocked | The prompt or image was refused by content checks | Change the prompt. Not charged, except on the Nano Banana stable channels (-1k, -2k, -4k) |
| 401 | invalid_api_key | The key is missing or wrong | Check the Authorization header |
| 402 | insufficient_credits | Not enough credits | Top up |
| 403 | account_suspended | The account or key is disabled | Contact support |
| 409 | idempotency_key_in_use | The Idempotency-Key was already used | Wait for the first request, or use a new key |
| 413 | request_too_large | The request or an image is too large | Send smaller or fewer images |
| 429 | rate_limit_exceeded | More than 300 requests in a minute | Slow down and retry |
| 429 | concurrency_limit_exceeded | More than 50 requests at the same time | Wait for one to finish |
| 429 | moderation_paused | More than 10 refused requests in an hour | Wait an hour |
| 502 | upstream_error | The image could not be generated | Retry. Not charged |
| 504 | upstream_timeout | Generation took longer than 420 seconds | Retry. Not charged |
When you are charged
Only for images you receive. Failed, timed-out and refused requests cost nothing. The exception: the Nano Banana stable channels (-1k, -2k, -4k) charge for images refused for their content, because the provider charges for them.
Rate limits and bulk generation
The request limits of the Cheapest Imagen API (300 a minute, 50 at once), what a 429 means, and how to generate thousands of images with retries that never charge twice.
Migrate from OpenAI
Move existing OpenAI Images API code to Cheapest Imagen by changing only the base URL and the API key; the request and response fields stay the same.