tinyx402

Error codes

Errors are JSON: { "error": "<code>", "message": "…" }. Only 2xx responses are ever settled.

StatuserrorChargedMeaning / what to do
400invalid_requestNoBody or query failed validation. details lists each issue. Fix and retry.
400/404/422invalid_requestNoTinyFish rejected the input. Details are in upstream.
402Payment requiredNoNo payment attached. Read PAYMENT-REQUIRED, sign, retry. x402 clients do this automatically.
402invalid_exact_evm_insufficient_balanceNoYour USDT balance is below the price.
402invalid_exact_evm_*NoBad signature, wrong domain, expired or reused authorization. Check extra and chain ID 1874.
429rate_limitedNoMore than RATE_LIMIT_PER_MIN requests per IP. Honor Retry-After.
502upstream_failedNoTinyFish failed, or an agent run ended FAILED (see error.category). Safe to retry once.
502all_failedNoFetch: every URL failed. Per-URL errors are in errors.
503service_unavailableNoThe upstream provider isn't available on this deployment. reason says why: operator_key_missing, operator_key_rejected or operator_out_of_credits (the operator has to fix these), or upstream_busy (retry later).
504upstream_timeoutNoUpstream didn't answer in time.
5xxsettlement errorNoThe facilitator couldn't settle. The response is withheld and nothing is transferred.

Client-side errors

These are thrown by @x402/fetch before anything is sent:

Message containsCause
spend control / no allowed payment requirementsThe server asked for an asset, network or amount outside your spendControls.
Failed to create payment payloadSigning failed, or the user rejected the request in their wallet.
Payment already attemptedYou passed a request that already had PAYMENT-SIGNATURE.

Background jobs

Research and Datasets settle when the job is accepted. If the job later ends FAILED, CANCELLED or TIMED_OUT, the poll endpoint reports it, but the payment is not reversed automatically.

SSE

/api/v1/agent/run-sse returns 402 and 400 as normal JSON responses before the stream opens. After it opens, failures arrive as:

text
event: error
data: {"error":"run_failed","message":"…","charged":false}