caft/docs
Dashboard

Troubleshooting

Every error has an HTTP status and a fixed error.code.

JSON
{
  "error": {
    "code": "insufficient_quota",
    "message": "This request was refused. The usual cause is insufficient credit — add credit from the billing page and retry.",
    "type": "insufficient_quota"
  }
}

Error codes

Statuserror.codeWhat to do
400invalid_requestCheck the body is valid JSON. Remove parameters the model may not support, and send only one of max_tokens and max_completion_tokens.
401invalid_api_keySend Authorization: Bearer sk-… with no stray spaces. Check that the key isn't revoked.
403insufficient_quotaUsually out of credit: buy credits, or lower max_tokens.
404unknown_endpointUse the base URL with /v1. Only Chat Completions, models and billing are served.
408request_timeoutRetry. For long outputs, stream.
413request_too_largeShorten the prompt or compact the conversation.
429rate_limit_exceededToo many requests for your account. Send fewer at once, and wait for Retry-After when it's set.
429plan_limitA limit of your monthly plan is used up. Wait for Retry-After or resets_at, or turn on Use balance.
500internal_errorRetry. If a request that used to work keeps failing, the model may not support it.
502upstream_errorThe provider failed. Retry shortly.
503model_unavailableCheck the model ID against GET /models, then retry, or fall back to another model.
504gateway_timeoutThe provider was too slow. Retry.

Back off on retries instead of retrying at once. A request that fails before any output is not charged. Before retrying a tool call, check whether the tool already ran.

x402 top-ups

Error codes for POST /api/x402/topup and POST /api/x402/plan (a monthly plan); see Pay with x402.

Statuserror.codeWhat to do
401invalid_api_keySend Authorization: Bearer sk-… with a caft API key.
402payment_invalidThe payment signature is not valid. Request a new quote and pay again.
402payment_expiredThe authorization expired before settlement. Start over.
402wrong_termsThe payment does not match the offer. Request a new quote.
402payment_refusedThe payment was refused. Nothing was charged.
402payment_screenedThe payer address failed compliance screening. Nothing was charged.
409payment_replayedThis exact authorization was already used. Sign a fresh one.
402insufficient_fundsThe paying wallet does not hold enough USDC on this network.
422invalid_amountamount_usd must be $1–$500 with at most two decimals.
422invalid_tier/api/x402/plan: tier must be plan10, plan25 or plan50.
409already_active/api/x402/plan: you already have this plan. Nothing was charged.
409tier_paused/api/x402/plan: this plan is not on sale right now. Nothing was charged.
409stripe_plan_active/api/x402/plan: your plan is billed by card; change it in the dashboard. Nothing was charged.
409downgrade_not_available/api/x402/plan: a lower plan can only start when your current plan ends. Nothing was charged.
409purchase_in_progress/api/x402/plan: a plan purchase is still being processed. Try again in a minute.
429rate_limit_exceededMore than 30 top-up attempts in an hour. Wait for Retry-After.
500settlement_unattributableThe settlement could not be attributed to your payment. Email support@caft.dev with the transaction hash.
503chain_unavailableCould not check the paying wallet's balance. Retry shortly.
503facilitator_unavailableThe payment facilitator is unreachable. Try again shortly.
503settlement_unknownThe settlement outcome is unknown. Check your balance before paying again.

Wallet accounts

Error codes for POST /api/x402/register and POST /api/wallet/keys; see Wallet accounts. Payment refusals use the same codes as the x402 top-ups table.

Statuserror.codeWhat to do
400invalid_requestSend { message, signature, action } as JSON; name must be 1–40 characters and revoke needs a numeric id.
401siwe_invalidThe sign-in message is not valid. Check the domain is caft.dev, chainId 8453, the nonce is fresh, and the statement names the action (caft wallet keys: create, …: list, …: revoke <id>).
401siwe_expiredThe sign-in message expired. Sign a new one.
401siwe_replayedThis sign-in message was already used. Sign a new one.
401wallet_unknownNo account exists for this wallet. Register with POST /api/x402/register first.
403account_disabledThis account is disabled. Contact support.
404not_foundWallet accounts are not enabled, or the key id is not on this account.
409wallet_registeredThis wallet already has an account. Get a key with POST /api/wallet/keys; add credit with POST /api/x402/topup.
409key_limitAn account can hold at most 10 keys. Revoke one first.
422invalid_amountamount_usd must be $5–$500 with at most two decimals.
429rate_limit_exceededMore than 30 signed requests per hour per wallet, or 5 registrations per hour from one address. Wait for Retry-After.
202registration_incompleteThe payment went through; the account is finished automatically within minutes. Then get a key with POST /api/wallet/keys.
503chain_unavailableCould not check the paying wallet's balance. Retry shortly.
503registration_busyToo many registrations are running right now. Wait for Retry-After.

A stream stops early

A complete stream ends with data: [DONE]. Treat anything else as incomplete, even if text arrived. If it ends at max_tokens with an unfinished tool call, raise the limit.

Empty answers

Reasoning models spend tokens thinking before they answer. If the app's response limit is low, they can run out before writing anything. Raise it to 2,048 or more.

The app wants another API format

caft serves OpenAI Chat Completions. For the Responses API or Anthropic Messages, put a translating router in between, such as LiteLLM or Claude Code Router; see Coding agents. If the app has no base URL field, use a router.

Still stuck

Check the status page, then email support@caft.dev with the status, the time, the model and the first few characters of your key. Never send the whole key.