Skip to content

Errors and limits

Error envelopes, machine error codes, timeout billing rules, retry guidance, rate limits, and live service status.

Every error returned by an inference endpoint or GET /v1/key includes x-request-id. Errors on POST /v1/messages also mirror that identifier in both the request-id header and the request_id body field. Include it whenever you ask support to trace a call.

Any call HeyEly dispatched upstream shows up in Credit and usage under that request ID, even when the upstream provider failed it.

Calls rejected inside the gateway before dispatch (gateway 400, 401, 402, 404, 413, 429, or 503 responses) are not recorded in Credit and usage.

Note that GET /v1/models/{id} answers unknown model IDs with a 404 carrying no request ID.

OpenAI envelope

Chat Completions, legacy Completions, Responses, Embeddings, Images, Models, and Key return OpenAI's error shape:

{
  "error": {
    "message": "This account has no credit left. Add credit in the dashboard to continue.",
    "type": "insufficient_credit",
    "code": "insufficient_credit",
    "param": null
  }
}

Anthropic envelope

POST /v1/messages returns Anthropic's error shape so Claude Code and Anthropic SDKs parse it natively:

{
  "type": "error",
  "error": {
    "type": "billing_error",
    "message": "This account has no credit left. Add credit in the dashboard to continue."
  },
  "request_id": "req_01K7Z4F2XQ"
}

Status and type

The table below maps HTTP statuses for errors generated directly by HeyEly (upstream provider errors follow the rules further down).

StatusOpenAI typeAnthropic type
400invalid_request_errorinvalid_request_error
401authentication_errorauthentication_error
402insufficient_creditbilling_error
403permission_errorpermission_error
404invalid_request_errornot_found_error
409api_errorconflict_error
413invalid_request_errorrequest_too_large
410api_errorapi_error
429rate_limit_errorrate_limit_error
502api_errorapi_error
503api_erroroverloaded_error
504api_errortimeout_error

Codes

Machine codes populate error.code in the OpenAI envelope; Anthropic's envelope exposes error.type only.

StatusCodeCauseFix
400invalid_jsonRequest body could not be parsed as JSONSend a valid JSON object
400missing_modelPayload omitted modelInclude a catalog model ID
400missing_promptLegacy Completions payload omitted promptInclude a prompt string or array
400invalid_parameterImages n is not an integer from 1 to 10Pass an integer between 1 and 10
400output_cap_requiredModel publishes no max output and no output cap was suppliedSet max_tokens on Messages or max_output_tokens on Responses
400unsupported_parameterPayload includes models, fallbacks, route, or provider; a plugins entry outside the free allowlist (response-healing, file-parser on cloudflare-ai or native, context-compression with enabled: false); an unsupported tool type (outside function, custom, and supported web search); X search; audio input; or a file sent to a model without native file support and no free parserPick one model and drop disallowed fields; Chat Completions auto-attaches cloudflare-ai for files, whereas Messages, Responses, Embeddings, Images, and Completions require setting it explicitly
400unsupported_modelModel bills per search (such as perplexity/sonar-deep-research)Switch to another model
401missing_api_keyNo credential header suppliedSend Authorization: Bearer sk-df-... or x-api-key
401invalid_api_keyKey does not match any active secretRe-check your saved key or mint a replacement
401api_key_disabledKey is pausedRe-enable it in Developers or use another key
401api_key_expiredKey passed its expiry timestampMint a new key
402insufficient_creditSpendable balance is zero or smaller than the call's hold (files and URL-referenced images/videos reserve the larger of the text estimate and the model's context window, or 1,000,000 tokens if unknown)Add credit, lower max_tokens, or reduce file/URL inputs
402key_limit_reachedKey reached its dollar cap or lacks headroom for this holdRaise the key cap, lower max_tokens, or switch keys
402free_credit_not_eligibleOnly free credit remains and the model or payload does not qualifyUse an open-weight text model, lower max_tokens, or add paid credit
402payment_requiredNeither API key nor x402 payment was provided while x402 is enabled; read the hold from PAYMENT-REQUIREDAuthenticate with a key or sign and retry with PAYMENT-SIGNATURE. See x402
400payment_invalidMalformed PAYMENT-SIGNATURE, mismatched payment terms, or keyed call paid by a wallet outside the key's accountInspect the message and re-sign the challenge
402payment_invalidSignature did not recover to from, wallet lacks bridged USDC, or nonce was already spent (reason in PAYMENT-RESPONSE)Fund the wallet on Elysium or sign with a fresh nonce
402payment_failedElysium settlement reverted or exceeded the 30-second confirmation window (PAYMENT-RESPONSE carries reason and transaction hash)Retry using a fresh nonce; nothing was credited
404model_not_foundModel ID does not exist in the active catalogQuery GET /v1/models and pick a live ID
413request_too_largeBody exceeds 32 MB (or 64 MB on Images)Trim the payload size
429rate_limitedExceeded 300 RPM on this key, or 20 RPM across keys on an account that has never added paid creditWait retry-after seconds; adding paid credit removes the 20-RPM cap
429too_many_concurrent_requestsKey already has 8 requests executing concurrentlyWait for an active request to complete and retry
502upstream_errorProvider failed or refused connection before accepting the callRetry safely; zero cost charged
502upstream_errorNon-streamed response dropped after the provider accepted itRetry; nothing is billed yet and the hold stays reserved
503service_unavailableInference gateway is temporarily unavailableRetry after a brief backoff
503model_prices_staleCatalog pricing for this model is over an hour stale, preventing safe billingRetry later or choose another model
504upstream_timeoutProvider missed the deadline: 120 seconds on Images, 15 minutes on other non-streamed calls, or 5 minutes for missing response headers / stalled bodyRetry; nothing is billed yet and the hold stays reserved

free_credit_not_eligible includes a self-contained message detailing eligibility rules and suggesting max_tokens. See Free credit.

The codes above cover inference routes and GET /v1/key. Public credit-sale GET endpoints return their own codes (400 invalid_parameter, 404 not_found, 502 chain_unavailable, and 502 quote_unavailable), while retired endpoints return 410 endpoint_retired.

A non-streamed timeout charges nothing yet and keeps its hold reserved. A streamed timeout before response headers returns 504 and costs zero. The OpenAI error.code is upstream_timeout. Messages uses error.type: timeout_error. After headers, a timeout interrupts the HTTP 200 stream. A reported cost is charged plus the 5% fee, OpenRouter's platform fee on an open model and the routing fee on a Private one. HeyEly adds no markup. Token counts with a generation id are a provisional estimate. Anything else does not charge the hold.

Provider errors

Upstream statuses tied to your input (400, 403, 404, 408, 409, 413, 422, and 429) keep their original HTTP code while HeyEly rewrites the body into the endpoint's standard envelope and strips raw upstream metadata.

Provider wording is normalized to safe, approved messages. Detected context-length, content-policy, invalid-parameter, and unsupported-parameter failures explain how to fix the call (preserving the phrase prompt is too long on context-length failures so Claude Code detects it cleanly), while unrecognized errors emit a standard message for that status without echoing raw provider diagnostics or internal token counts.

On POST /v1/messages, valid Anthropic errors keep their error.type; other responses map to HeyEly's status type (using conflict_error for non-Anthropic 409s) and stamp HeyEly's request_id in the body and x-request-id / request-id headers.

Upstream 401 and 402 statuses (indicating a gateway-to-provider issue) translate to 503; all other upstream failures translate to 502. Every translated response keeps your request ID without leaking upstream credentials or account details.

Failures after a stream starts

Once response headers flush with HTTP 200, any mid-stream failure stays inside the stream: provider error frames relay through, whereas abrupt upstream disconnects close the stream without an error event. Credit and usage marks those calls Failed.

A failed request is charged the provider's reported cost plus the 5% fee, OpenRouter's platform fee on an open model and the routing fee on a Private one. HeyEly adds no markup. Token counts with a generation id are a provisional estimate. Anything else does not charge the hold. Read Streaming events.

Retry

Apply exponential backoff with jitter on 429, 502, 503, and 504, always honoring retry-after (integer seconds) when supplied.

Never blindly retry 400, 401, 402, 404, or 413 before addressing the underlying cause. See Rate limits.

Rate limits

Limits

LimitValueWhen exceeded
Requests per minute300 per key429 rate_limited with retry-after (Messages: rate_limit_error)
Requests in flight8 per key429 too_many_concurrent_requests with retry-after: 1 (Messages: rate_limit_error)
Requests per minute before credit is first added20 per account across all keys429 rate_limited with retry-after (Messages: rate_limit_error)
CreditAvailable account credit must cover the call's hold402 insufficient_credit, or 402 free_credit_not_eligible when only free credit remains and the call does not qualify (Messages: billing_error)
Key credit limitConfigured key cap minus active holds on that key402 key_limit_reached (Messages: billing_error)
Request body32 MB, or 64 MB on Images413 request_too_large (Messages: request_too_large)
Time to answer120 seconds for Images (including streams); non-streamed text times out at 5 minutes on missing headers or body stalls and 15 minutes total; text streams have no total cap but enforce the same 5-minute header/body stall timeoutBefore headers: 504 (upstream_timeout on OpenAI endpoints, timeout_error on Messages). After headers: the HTTP 200 stream ends

Every limit tracks per API key except the 20-RPM pre-credit cap, which spans the entire account. Limits govern every model endpoint; OpenAI routes populate error.code, whereas Messages reports error.type only.

A non-streamed timeout charges nothing yet and keeps its hold reserved. A streamed timeout before response headers returns 504 and costs zero. The OpenAI error.code is upstream_timeout. Messages uses error.type: timeout_error. After headers, a timeout interrupts the HTTP 200 stream. A reported cost is charged plus the 5% fee, OpenRouter's platform fee on an open model and the routing fee on a Private one. HeyEly adds no markup. Token counts with a generation id are a provisional estimate. Anything else does not charge the hold.

The 20 per minute limit

Accounts that have never added paid credit share a 20-requests-per-minute ceiling across every key (called out in the error message). Adding credit via bridged USDC or credit tokens, or claiming holder rewards as service credit, lifts this ceiling; buying unactivated credit tokens does not. Per-key limits of 300 RPM remain active. See Free credit.

Retry

Every 429 includes retry-after as whole seconds; wait that duration before retrying. On too_many_concurrent_requests, your key already has 8 concurrent calls active, so wait for one to finish or throttle client concurrency below 8.

import random
import time

import requests


def post_with_retry(url, headers, body, attempts=5):
    for attempt in range(attempts):
        response = requests.post(url, headers=headers, json=body, timeout=120)
        retryable = response.status_code in (429, 502, 503, 504)
        if not retryable or attempt == attempts - 1:
            return response
        wait = float(response.headers.get("retry-after", 2**attempt))
        time.sleep(wait + random.random())

Skip retries on 400, 401, 404, and 413, and skip retrying 402 when your account or key truly has zero balance. A 402 triggered purely by concurrent in-flight holds can succeed once earlier calls finish and release their holds. See Errors.

Stay under the limits

  • Pool HTTP connections and cap per-key concurrency at 8 in-flight calls.
  • Issue a dedicated key per tool or background worker so noisy jobs cannot starve interactive editors.
  • Pass explicit output caps (max_tokens on Chat Completions, Messages, and legacy Completions, or max_output_tokens on Responses). On Chat Completions and legacy Completions not paid by free credit, omitting a cap holds the model's maximum output (or 8,192 if unknown), clamped at 32,768 and sent upstream as max_tokens; explicit caps above 32,768 hold in full up to the model's maximum. On Messages and Responses, omitting a cap holds the model's full published maximum output (which can exceed 32,768) and returns 400 output_cap_required if none is published.

Active credit holds clear automatically the moment a request completes. See Pricing.

Status

Check /api/status.json anytime (public, no API key required) if sign-in, inference, or credit top-ups seem delayed. For usage metrics and Elysium chain totals, see Network data.

curl https://heyely.si/api/status.json

The payload follows Statuspage v2 (page, status, components, and active incidents), plus a 90-day recent_incidents archive and a meta block explaining methodology. status.indicator reports none, minor, major, critical, or unknown, while each component reports operational, degraded_performance, major_outage, or unknown. A 503 carrying indicator unknown signals that status data could not be loaded. Subscribe to incident updates via the RSS feed at /api/status/feed.xml.

Read each component

Automated probes check live services every 60 seconds and check keeper and upstream balances hourly. Each component inherits the worst state among its underlying probes (a single model outage impacts both Chat and API), and the JSON exposes every underlying probe by name.

Three consecutive probe failures mark a check down, while slowness or partial errors mark it degraded. Stale service probes flip to unknown after 3 minutes (3 hours for balance probes), and unknown intervals are excluded from uptime percentages.

ComponentWhat it covers
ChatWeb chat, docs, and the model infrastructure serving them
APIDeveloper API routes (chat, messages, responses, embeddings) and backing models
CreditBuying and activating credit and updating balances
Sign-inNew authentication sessions (existing keys, active sessions, and API calls keep working)

Follow incidents

Active incidents list impacted services and their current lifecycle phase (Investigating, Identified, Monitoring, or Resolved) and can elevate overall severity. Resolved incidents remain visible inside recent_incidents for 90 days. Because incident notices are authored by operators, automated probes can mark a component degraded or down ahead of a written post.