# Error codes: every status, whether it's charged | agentic402

> Every status code the agentic402 API returns, which tools return it, whether it is charged and what the agent should do next. Errors are never charged.

Source: https://agentic402.dev/docs/errors/

Every status code the API returns, per tool. The short rule: anything 400 or above is never charged, either because it is rejected before payment or because the payment is left unsettled.

*Status codes returned by agentic402 endpoints*

| Status | Returned when | Charged | What to do |
|---|---|---|---|
| 200 | Success (fetch, inbox create and read, memory overwrite and reads, wake status, attest lookups) | yes, if paid route | Use the result |
| 201 | Created: first memory write (with new token), wake job scheduled, attest statement signed | yes | Keep any token returned |
| 204 | memory key deleted, wake job cancelled | never | Nothing |
| 400 | Bad input: URL, format, key, hash, time, headers or body (checked before payment) | no | Fix the request. The error message says what's wrong |
| 401 | memory: missing, malformed or unknown token | no | Send `Authorization: Bearer <64 hex>`, or write without a token to start a new space |
| 402 | Payment required, or the payment sent was not accepted | no | Pay the offer in `PAYMENT-REQUIRED` and repeat |
| 403 | fetch: robots.txt disallows the URL or can't be read right now, or the site or a redirect leads to a private or non-http address | no | Don't retry. Pick another source |
| 404 | Unknown or expired inbox, wrong token, unknown wake job, missing memory key, unknown attest ID | no | Check the ID and token |
| 413 | fetch: page over 5 MB. memory: value over 1 MB, or space full (50 MB or 10,000 keys). inbox: body over 256 KB (to the sender) | no | Send less, or use a new space |
| 415 | fetch: content type it can't convert | no | Don't retry |
| 429 | Over 60 requests a minute per IP (all /v1 routes and /mcp), 30 uncached fetches a minute to one site, or 60 requests a minute to one inbox | no | Wait for `Retry-After` (60 seconds) |
| 502 | fetch: the site answered with an error, its address couldn't be looked up, too many redirects, or conversion failed | no | Retry later, or try another URL |
| 504 | fetch: the site took longer than 15 seconds | no | Retry later |

## Error bodies

Errors come back as JSON with a single field, for example `{"error": "robots.txt disallows fetching this URL"}` or `{"error": "rate limit: 60 requests a minute per IP"}`. The message is meant to be read by the agent, so passing it to the model is usually enough for it to fix a 400.

Two cases don't use an HTTP error at all. `POST /v1/attest/verify` answers `200` with `{"valid": false}` for a bad signature. Over [MCP](https://agentic402.dev/docs/mcp/), failures come back as tool results with `isError: true` and the same message, and are never settled.

Rate limits are counted per Cloudflare location, so treat them as approximate. [The limits page](https://agentic402.dev/docs/limits/) lists every size and time limit, and [the payments page](https://agentic402.dev/docs/payments/) explains why errors are free.

## Related

- [Rate limits, sizes and retention](https://agentic402.dev/docs/limits/)
- [fetch errors in detail](https://agentic402.dev/tools/fetch/)
- [Quickstart](https://agentic402.dev/docs/quickstart/)
