Skip to Content
Docs

Errors

Every refusal is a JSON problem with a stable code your code can read.

A refused call answers an HTTP error status with an RFC 9457 problem, as application/problem+json:

{
  "type": "about:blank",
  "title": "Forbidden",
  "status": 403,
  "code": "insufficient_scope",
  "detail": "create_with_awen needs a key with awen:create and awen:write. Make a key with that access in Settings."
}

Read code in your code, and show detail to people. Codes are only ever added. Some problems carry more:

  • issues, with invalid_request: where each invalid argument is and why, never the value it held.
  • retry_after_seconds, with rate_limited and busy: how long to wait, as the Retry-After header says.
  • limit, with rate_limited: the limit the call went over, as scope (key, organisation or address), units and window_seconds.

Codes

StatuscodeMeans
400invalid_jsonThe body is not JSON.
400invalid_requestThe arguments are not valid; issues lists them.
400idempotency_key_requiredcreate_with_awen needs an Idempotency-Key header.
401missing_api_keyThe call has no Authorization header.
401invalid_api_keyThe key is mistyped, revoked or expired.
403browser_not_allowedA browser sent the call. Call from a server.
403access_offAn Owner turned assistant and API access off.
403plan_requiredThe organisation has no paid plan or trial, or its payment is overdue.
403membership_suspendedYour access to the organisation is suspended.
403insufficient_scopeThe key lacks the permission this operation needs.
404unknown_operationNo operation has this name.
404not_foundAn id in the arguments names nothing you can reach.
409conflictThe request conflicts with the current state, such as a name in use.
409limit_reachedA limit is reached, such as a full project.
413payload_too_largeThe body is larger than the operation accepts.
415unsupported_media_typeSend Content-Type: application/json.
422refusedThe request is valid, but Awen cannot do it; detail says why, such as no balance left.
429rate_limitedOver a rate limit; limit names it. Wait retry_after_seconds. See Limits.
500internal_errorAwen failed. We are told; try again later.
503busyAwen is busy and started nothing. Wait retry_after_seconds.
503not_configuredThe API is not available right now.
504timeoutThe operation took too long.

Not enough balance

A paid plan opens the API; the organisation's balance pays for what it makes. When the balance or a spending limit does not cover a request, create_with_awen and enhance answer 422 with the code refused, and start nothing. A turn that runs out of balance while it runs ends failed, and its failure says so. Reading and organising cost nothing, except that an imported image or video is described and tagged at the price of an upload in the app.

Retrying

Retry 429 and 503 after retry_after_seconds, and 504 after a few seconds. Send create_with_awen again with the same Idempotency-Key, so a retry never charges twice. Do not retry other codes unchanged: they give the same answer.

On this page