GoodPut AI

Errors and rate limits

Error structures, code mappings, retry guidance, and rate limits for both protocols.

Errors follow the protocol you call. OpenAI-compatible endpoints, including /v1/chat/completions, /v1/responses, /v1/embeddings, and /v1/videos, use OpenAI definitions. /v1/messages uses Anthropic definitions. Official SDKs can handle their corresponding exception classes directly.

Error structures

OpenAI-compatible endpoints:

{
  "error": {
    "message": "Your organization's balance is used up — top up in the console to continue; retrying will not help(组织余额已用完,请在控制台充值后继续;重试无效)",
    "type": "insufficient_quota",
    "param": null,
    "code": "credit_balance_exhausted",
    "goodput_reason": "balance_exhausted",
    "goodput_scope": "org"
  }
}

Anthropic-compatible endpoints (/v1/messages, /v1/messages/count_tokens):

{
  "type": "error",
  "error": {
    "type": "billing_error",
    "message": "Your organization's balance is used up — …(组织余额已用完…)",
    "goodput_reason": "balance_exhausted",
    "goodput_scope": "org"
  },
  "request_id": "5b1d…"
}

The example message values deliberately retain both English and Chinese, as returned by the API.

FieldDescription
error.type / error.codeFollow official OpenAI and Anthropic values; SDKs use them to raise the corresponding exceptions
error.goodput_reasonA rejection reason shared across both protocols, useful for unified handling; see below
error.goodput_scopeThe budget layer reached by a quota error; see budget errors
error.messageA bilingual explanation for troubleshooting; do not use it for programmatic decisions

Error code reference

Statusgoodput_reasonOpenAI type / codeAnthropic error.typeCommon causeAction
400invalid_requestinvalid_request_errorinvalid_request_errorInvalid body, missing model / messages, or invalid parameter valuesCorrect the request using the error details
400unsupported_optioninvalid_request_error / unsupported_valueinvalid_request_errorA model does not provide the requested option, such as a video resolution tierUse one of the available values listed in the error
400context_length_exceededinvalid_request_error / context_length_exceededinvalid_request_error (message starts with prompt is too long)Input exceeds the context windowShorten input or use a larger-context model
400content_policyinvalid_request_error / content_policy_violationinvalid_request_errorContent blocked by a safety policyAdjust the input
401authentication_failedinvalid_request_error / invalid_api_keyauthentication_errorMissing, invalid, deleted, expired, or disabled keyCheck Authorization: Bearer or x-api-key
403permission_deniedinvalid_request_error / permission_deniedpermission_errorThe key cannot access this resourceCheck key permissions
404model_not_foundinvalid_request_error / model_not_foundnot_found_errorModel ID missing, not on sale, not enabled for your account, or unsupported by this endpointCheck the catalog; if the ID is correct, contact support for access
404not_foundinvalid_request_error / not_foundnot_found_errorResource not found, such as a video task IDCheck the ID
409conflictinvalid_request_error / conflictconflict_errorCurrent resource state conflicts with the operation, such as downloading an unfinished videoWait for the state to change
413request_too_largeinvalid_request_error / request_too_largerequest_too_largeRequest body exceeds the byte limitReduce the body size
429balance_exhaustedinsufficient_quota / credit_balance_exhaustedbilling_errorFunds exhausted, including an arrears freezeAdd funds; service resumes without recreating keys. Retrying does not help
429spend_limit_reachedinsufficient_quota / see budget errorsbilling_errorA key, team, member, or subscription cap is reached, even if funds remainRaise the relevant cap or wait for its reset. Retrying does not help
429rate_limitedrate_limit_error / rate_limit_exceededrate_limit_errorRequest rate, token rate, or concurrency exceededWait according to retry-after, then retry
500internal_errorserver_errorapi_errorInternal platform errorRetry later
502upstream_errorserver_errorapi_errorUpstream model service errorRetry later, or configure fallbacks
503overloadedservice_unavailable_error / server_is_overloaded— (see next row)Model overloaded with no available capacityWait according to retry-after, then retry
529overloaded—overloaded_errorSame overload condition; Anthropic uses 529Same as above
503internal_errorserver_errorapi_errorService temporarily unavailableRetry later
504upstream_timeoutserver_error / timeouttimeout_errorUpstream model timed outRetry; use streaming for long outputs

Exhausted funds return 429, not 402. Rate limits also use 429. Distinguish them using goodput_reason, OpenAI code, or Anthropic error.type: retrying balance or budget errors does not help; rate limits can be retried after retry-after.

Budget errors

balance_exhausted means the charged personal account or organization has run out of funds. spend_limit_reached means a configured limit was reached even though funds may remain. goodput_scope identifies the affected layer:

goodput_scopeMeaningOpenAI code
orgOrganization funds exhaustedcredit_balance_exhausted
accountPersonal account funds exhaustedcredit_balance_exhausted
keyThis key’s spending capapi_key_spend_limit_exceeded
team / projectTeam or project capproject_spend_limit_exceeded
memberYour membership budget within the teammember_spend_limit_exceeded
subscriptionSubscription quotasubscription_quota_exceeded
userIndividual member’s cap within the organizationspend_limit_exceeded
end_userCap for an end user identified by the request’s user fieldspend_limit_exceeded
tagCap configured for a tagspend_limit_exceeded

Retry guidance

Error responses include retry-related headers that official SDKs observe automatically:

  • x-should-retry: false: retrying is pointless, for example invalid parameters, invalid keys, or exhausted funds/budgets. Official OpenAI and Anthropic SDKs do not retry automatically when this is set.
  • retry-after: recommended wait in seconds for rate limiting or overload.
RetryableNot retryable
rate_limited, overloaded, upstream_timeout, upstream_error, internal_errorAll other goodput_reason values, including balance and budget 429 errors

For cross-model recovery, use the request-level fallbacks parameter so the gateway handles switching.

Errors in streaming requests

  • Before any output has been sent, failure returns a normal error response with the actual status code and JSON structure above.
  • After output begins, HTTP status is already 200. The error arrives as an event: data: {"error": {…}} for OpenAI, or event: error with the Anthropic structure above. Official SDKs convert these events into exceptions.

Rate limits

Account and project limits apply to both request frequency and token rate. Organization administrators can configure separate project limits in the console.

Enterprise customers can contact us for higher limits or dedicated quotas.

Reporting a problem

Every error includes a request ID in x-goodput-request-id. OpenAI-compatible responses also provide x-request-id; Anthropic provides request-id and a body request_id. It is the same request_id shown in console request logs. Provide it to support with the time and model ID for faster investigation.

On this page