Faelith
ContactDownload
Errors and rate limits

API

Errors and rate limits

Status codes, error bodies, and how meters and the wallet produce 402s.

Errors use the OpenAI error envelope: a stable error.code you can branch on, an error.type category, a human error.message, and error.param naming the exhausted meter window when relevant.

json
{
  "error": {
    "message": "plan limit reached for the 5h window",
    "type": "insufficient_quota",
    "param": "5h",
    "code": "plan_limit_reached"
  }
}

Status codes#

StatusCodeTypeMeaning
400invalid_requestinvalid_request_errorMalformed body, unknown field, unsupported content part
400model_not_foundinvalid_request_errorUnknown model id, or a model this key may not use
400extraction_blockedinvalid_request_errorThe request was classified as an attempt to extract system prompts or weights
401invalid_api_keyauthentication_errorMissing, malformed or revoked key
402plan_limit_reachedinsufficient_quotaA rolling meter is full; param is 5h or weekly
402insufficient_quotainsufficient_quotaPrepaid wallet is empty (API keys, or usage-based Code/Chat)
429rate_limit_exceededrate_limit_errorToo many concurrent requests on one key; back off and retry
500internal_errorapi_errorRetry with backoff; include the request id when contacting support
502upstream_errorapi_errorThe model fleet returned an error; safe to retry
503cluster_at_capacityapi_errorFleet at capacity; retry after a short delay
503capture_unavailableapi_errorMandatory encrypted capture storage is temporarily unavailable

Meter headers#

Every response, including errors, carries the current meters so clients can show budget without an extra call:

http
x-faelith-plan: pro
x-faelith-code-5h-used: 1210000
x-faelith-code-5h-limit: 3730000
x-faelith-code-weekly-used: ...

Values are micro-dollars of list-price debit.

Budgets versus throttling#

A 402 means a budget ran out and will not clear by retrying:

  • Subscription keys hit the 5-hour meter first, then weekly. Wait for the window or redeem a usage reset.
  • API keys debit the wallet at list price. Top up under Spending.
  • Turning on usage-based billing lets subscription keys fall through to the wallet instead of failing.

A 429 is the only throttling signal and is per key and short-lived.

Idempotency#

Chat completions are not idempotent. If a stream drops mid-response you are billed for the tokens generated so far; resend with the partial assistant message appended if you want to continue rather than restart.

Found a mistake or a gap? Tell us and we will fix the page.