Skip to Content
NoCam API
Errors

Errors

Every code the API can answer with, what it means and what to do.

There are two places an error can appear. Neither one costs credits.

Refused at once

The call answers with an HTTP error, and nothing started:

{
  "error": {
    "code": "invalid_parameter",
    "message": "gpt-image-2 doesn't support aspect ratio 5:4.",
    "path": "input.aspect_ratio",
    "hint": "Use one of: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9.",
    "retryable": false,
    "request_id": "req_01a1b37b65dc7dcd8c060f296add5cf8",
    "docs_url": "https://docs.nocamclub.com/errors/invalid_parameter"
  }
}
FieldWhat it is
codeStable, safe to write code against
messageWhat happened, for people and agents
pathThe field at fault
hintWhat to do about it
retryableWhether the same request can work, after any wait the error names
request_idQuote this if you contact us
docs_urlA page about this code

Some codes add fields, such as credits, balance and top_up_url on insufficient_credits, or limit on rate_limited.

CodeHTTPMeaningWorth retrying?
invalid_request400The request can't be readAfter a change
invalid_parameter400A field is wrongAfter a change
unknown_model400That model isn't on saleAfter a change
input_refused400Refused by content rulesAfter a change
invalid_api_key401The key isn't validNo
expired_api_key401The key has expiredNo
insufficient_credits402Not enough creditsNo
account_suspended403The account is pausedNo
ip_not_allowed403Not from this addressNo
missing_scope403The key can't do thisNo
model_not_allowed403The key can't use this modelNo
origin_not_allowed403Not from this pageAfter a change
spend_limit_reached403A spend limit is reachedNo
not_found404Not foundAfter a change
idempotency_conflict409This key was used with another requestAfter a change
no_route409No route can do this right nowAfter a change
not_cancelable409Too late to cancelAfter a change
not_finished409Still in progressYes
not_for_sale409Not on sale with these settingsAfter a change
upload_not_found409The file isn't there yetYes
file_too_large413The file is too bigAfter a change
unsupported_media415We can't read this fileAfter a change
rate_limited429Too many requestsYes
too_many_active429Too many in progressYes
internal500Something went wrong on our sideYes
platform_paused503The API is pausedYes

On a failed generation

The call was accepted, and later the generation ended with status: "failed". The credits are already back.

{
  "status": "failed",
  "price": {
    "credits": 4,
    "usd": "0.04",
    "charged": false
  },
  "error": {
    "code": "content_refused",
    "message": "The model refused this request under its content rules. Your credits came back. Change the prompt or the files before trying again.",
    "hint": "Change the prompt or the files. Trying the same again can't help, and refusals count toward a pause of the account.",
    "retryable": false,
    "docs_url": "https://docs.nocamclub.com/errors/content_refused"
  }
}

It has the same hint and retryable as a refused call. To try again, send the same request with a new Idempotency-Key.

CodeMeaningWorth retrying?
content_refusedThe model or our check refused itAfter a change
bad_input_fileThe model couldn't read a fileAfter a change
unsupported_requestThe model can't do this combinationAfter a change
prompt_too_longThe prompt is too longAfter a change
output_limitThe answer didn't fitAfter a change
timed_outThe model didn't finish in timeYes
provider_unavailableNo route could run itYes
generation_failedThe generation failedYes
sandbox_failureThe sandbox failed it on requestAfter a change
canceledCanceledAfter a change

input_refused can also arrive here, when a model refuses one of your files after the start.

Retrying a failed generation needs a new Idempotency-Key: the old one returns the same failure.

On this page