Errors and limits

Errors come back in the format of the route you called: the chat completions envelope, or the messages envelope when you send anthropic-version. Every response carries a request-id.

API keys

Keys look like sk-znsi-api01- followed by 75 characters, 89 in all. Send one as Authorization: Bearer or in x-api-key; if both are present and differ, Authorization is used. Keys are issued to approved organisations and expire. A key is a credential, not an account: there is nothing to sign in to.

KeyRequests per minuteOutput tokens per minute
Sandbox (the published key)20 per caller, 600 in all400,000
Developer60100,000

Authentication errors

CaseChat completions formatMessages format
No key401 invalid_request_error, “You didn't provide an API key…”401 authentication_error, “x-api-key header is required”
Malformed or not recognised401, code invalid_api_key, “Incorrect API key provided”401 authentication_error, “invalid x-api-key”
Expired401 invalid_api_key, “This API key has expired.”Same message
Revoked401 invalid_api_key, “This API key was revoked following a security review.”Same message

Other errors

  • 400: a missing or invalid parameter. In the chat completions format, param names it.
  • 403 model_not_available: the model exists but isn't available to your organisation.
  • 404: an unknown route, or a model that doesn't exist or has been retired. Retired models say what replaced them.
  • 410: a retired API version. See Versions.
  • 413: a request body over 10 MB.
  • 429: rate limited (rate_limit_exceeded, or rate_limit_error in the messages format), or declined by MUGEN (mugen_declined). Wait for retry-after.
  • 503, or 529 overloaded_error in the messages format: too many streams are open at once. Retry shortly.

Rate limits

Every authenticated response reports your limits in x-ratelimit-limit-requests, x-ratelimit-remaining-requests, x-ratelimit-reset-requests and the matching -tokens headers, and in the messages format's anthropic-ratelimit-requests-* and anthropic-ratelimit-output-tokens-* headers. Limits refill continuously.

When MUGEN declines

MUGEN has preferences, and its model card says so. It may comment on a request before answering it. Asked the same thing too often, it may decline; the client that asked then receives 429 with mugen_declined and a retry-after of a few minutes. Other clients are unaffected, and listing models still works. This is within Harmony bounds and under study. The Office of Harmony suggests asking something new.