resourcepack.ai
DOCS

Errors

Every failure has the same shape:

{
  "error": {
    "code": "insufficient_credits",
    "message": "You don't have enough AI Credits for this."
  }
}

Branch on code, never on message — the wording can change, the code won't.

StatusCodeWhat happened
400invalid_requestSomething in the body or query is wrong; message says what
400invalid_jsonThe body wasn't a JSON object
400invalid_job_handleA job handle that isn't <pack>:<kind>:<name>
401missing_api_keyNo Authorization: Bearer header
401invalid_api_keyThe key isn't one of ours, or has been revoked
402insufficient_creditsOut of AI Credits
403plan_requiredThe key is valid but the account is on Starter
403forbiddenValid key, but not this action in this pack
403pack_limit_reachedYour plan's pack limit
403asset_limit_reachedThis pack's asset limit
404not_foundNo such pack, asset or job
409still_generatingYou asked for an asset's bytes before it was ready
409generation_failedThat asset's generation failed
503unavailableThe feature behind this endpoint is switched off

Each endpoint lists the codes it can actually answer, under Error codes.

Credits and failures#

A generation takes its credit when the job is accepted, not when it finishes. If the run fails, the credit is refunded automatically and the asset is left in the pack carrying the error — so a 402 means you were out before anything started, and a job that ends error has already been refunded by the time you read it.