Errors
Every error Meadow makes outside the model routes has the same JSON body. Read the HTTP status first, then error.type, then error.message. The model routes answer in OpenAI’s or Anthropic’s own error format, with the same status and the same error.code: see Errors on model routes.
The x-request-id header and the request_id field carry the same id: see Request IDs.
The error body
Meadow’s messages never contain a provider’s error text or any key.
Two things differ on the model routes. Meadow’s own errors use the provider’s envelope there: see Errors on model routes. And some provider errors are passed through as the provider wrote them: see Provider errors on model routes.
Types
Every 409 carries the type conflict. Before 2026-11-24 a 409 carried invalid_request, the same as a 400. If your code matched on that, match on the status or on conflict now.
Codes
Every Meadow error carries error.code, a stable name for the specific failure. Several codes share one type. Branch on type first and on code when you need to tell two failures apart, for example api_key_expired from api_key_revoked. Meadow can add a code at any time, so treat a code you do not know as its type.
Validation errors also carry error.param: the body field, query parameter or header at fault. A nested field is written with dots, such as credentials.api_key.
A field of the wrong JSON type is named too, on every route that takes a JSON body: {"name": 123} returns parameter_invalid with "param": "name" and the message name must be a string. So are the validation errors of POST /v1/sandboxes, such as resources.memory_mb or provider.options.daytona.spot.
The sandbox, image and model routes do not name every failure yet. Where they have no narrower code, code repeats the type (internal becomes internal_error), and param is absent.
A spent limit is a 403 and not a 429 on purpose. A client that retries a 429 would otherwise resend a call that a spent key can never make. A spent dollar limit is a 402 for the same reason.
Attempt outcomes
Each entry in attempts has one of these outcomes: served, unsupported (the provider cannot meet the request), refused, no_capacity, timeout, rate_limited, error.
Common messages
These were all returned by the hosted beta on 2026-11-24. Each body also had a request_id field, left out here to keep the table short. The bodies are shown in Meadow’s envelope, as they were captured. Since 2026-11-28 a model route writes the same status, code and message in the provider’s envelope: see Errors on model routes.
Meadow is strict about request bodies on its own routes. Unknown fields, duplicate fields, and wrong letter case are rejected, never ignored. On model routes the body is the provider’s format and extra fields pass through to the provider.
Query strings are not strict. A query parameter Meadow does not know is ignored without an error. GET /v1/keys?project_id=... returns the keys of every project, and PUT .../files?path=...&mode=755 writes the file with mode 0644. Check the parameter names in the API reference before you rely on a filter.
Three messages can mislead:
-
An unknown-field message does not name the field, but
error.paramdoes.unknown field in sandbox create requestcame back for a body that sentcommand, with"param": "command". The usual causes are a field from another API (cmd,workdir,commandon create) and a field in the wrong object. -
unknown modelalso appears when you misspell a real model.GET /v1/modelslists the IDs your key can call. The message carries the id and a pinning example. Meadow passes an unlistedclaude-,gpt-,gemini-orgrok-id to its own provider when you have that provider’s key, so a misspelt id of those families comes back as the provider’s 404. To call any other model Meadow has not listed, pin the provider:<provider>/<model>. -
A format mismatch has two messages. When no provider Meadow knows for the model accepts the format (for a pinned id, the pinned provider), you get a 400
no provider accepts this format for the requested model. When other providers accept it but the ones you allowed withonlydo not, you get a 422no allowed provider can serve this request, even though a key for the allowed provider is stored. For example, a Messages request limited to a provider that only takes Chat Completions. Models shows which provider accepts which format.
Errors on model routes
POST /v1/chat/completions, POST /v1/responses, POST /v1/messages and GET /v1/models are the routes you call with the OpenAI and Anthropic SDKs. An error Meadow makes on those paths is written in that format’s own envelope, so the SDK raises its usual typed error and its fields are filled.
This covers every Meadow error on those paths: a missing key, a wrong method, a spent limit, a failed route. It also covers the provider paths Meadow does not serve, such as /v1/embeddings and /v1/messages/count_tokens. Every other route (keys, projects, provider keys, sandboxes, images, build contexts, usage) uses the error body above. Before 2026-11-28 the model routes used it too: see the changelog.
On /v1/chat/completions, /v1/responses, /v1/models and the unserved OpenAI paths, the body is OpenAI’s:
On /v1/messages and the paths under it, the body is Anthropic’s:
On the Gemini route (/v1beta/models/... and POST /v1/models/{model}:generateContent), the body is Google’s. error.code there is the HTTP status, error.status its Google name, and Meadow’s code is the reason of an ErrorInfo detail and its metadata.code. The list of attempts is left out. See Gemini clients. Not on the hosted beta yet.
What stays the same as on every other route, in OpenAI’s and Anthropic’s envelopes:
- The HTTP status.
error.code, with the values in Codes. In Anthropic’s envelope the same value is also aterror.details.error_code, where Anthropic’s format carries a code and the Anthropic SDKs read it.error.message,error.paramanderror.attempts. In OpenAI’s envelopeparamisnullwhen there is none.request_id,x-request-id,retry-afterandx-should-retry.
What differs is error.type, which follows the provider:
OpenAI itself answers a bad key with status 401 and the type invalid_request_error, and its SDKs choose the error class from the status alone. So in OpenAI’s envelope every 4xx except 402 and 429 has that one type. Branch on the status and on error.code.
The 402 row is for a key that has spent a dollar limit. It uses the type each provider gives a billing or quota rejection: insufficient_quota for OpenAI and billing_error for Anthropic. A 405 on a model route carries the Allow header, as on every other route.
With the OpenAI Python SDK:
With the Anthropic Python SDK:
Both SDKs were run against these bodies in Meadow’s tests, with a mock transport and no network. They were not run against the hosted beta.
Provider errors on model routes
Meadow sorts a provider’s error into one of two groups.
A request error (the provider’s 400, 409, 413, or 422, or a 404 for a model id you pinned to that provider or from the only provider in the route) is your request’s fault, and another provider would not help. Meadow returns the provider’s status, body, and content type as written. That body is the provider’s own. An OpenAI or Anthropic body has the same envelope as a Meadow error on that route, without Meadow’s code, attempts and request id. A Google or xAI body has its own shape. A Bedrock body is rewritten into Anthropic’s envelope, {"type":"error","error":{"type":...,"message":...}}, with AWS’s message and a type from the status (invalid_request_error for 400, not_found_error for 404), because Bedrock’s own body ({"message":...}) is not an Anthropic error. A Vertex body in Google’s shape is rewritten into the route’s envelope: {"type":"error","error":{"type":...,"message":...}} on /v1/messages, and {"error":{"message":...,"type":...,"param":null,"code":...}} on Chat Completions, where code is Google’s status (such as RESOURCE_EXHAUSTED). Google’s message is kept, the error type follows the HTTP status, and the content type is application/json.
A vendor error body never carries the key or token Meadow sent to that vendor. Meadow replaces each copy with [REDACTED], and does the same for an error event inside a stream (see Streaming). Only the exact text Meadow sent is matched.
Everything else (a connection error, a timeout, a 5xx, a 408, a 429, or the provider refusing your stored key with 401, 402, or 403) makes Meadow try the next provider. If every provider fails, you get a Meadow error with attempts.
To tell the two apart in code: a response with the header x-meadow-provider and a 4xx status came from that provider. Parse it in that provider’s format. A response without it is a Meadow error, in the envelope of the route.
Models lists the x-meadow-* headers, and Routing and fallbacks lists every provider result and whether it falls back.
Retrying
Safe to repeat as often as you like: every GET, every DELETE, and every PUT.
Safe to repeat only with an Idempotency-Key header: POST /v1/sandboxes and POST /v1/sandboxes/{sandbox_id}/exec with background: true. A repeat with the same key and body returns the first result. Without the header, each send creates a new sandbox or starts the command again.
Not safe to repeat blindly:
POST /v1/projects,POST /v1/keysandPOST /v1/imagesare safe to repeat with anIdempotency-Keyheader. A repeat within 24 hours returns the saved first response withIdempotent-Replayed: true. Only a 2xx is saved: after a 4xx or a 5xx the same key runs the request again. The value belongs to the API key that sent it. A replay carries no one-time secret: nosecreton a key, nowebhook_secreton a project. Without the header, list before you create again.- A blocking or streamed command runs again.
- A model call. Retry it on a 429 only, after the seconds in
retry-after. A 429 means no provider took the call, so a second send is safe. Do not resend it after a 5xx or a timeout: Meadow has already tried every provider in the route before it answers 5xx, so a retry repeats work the server already did. A provider may also have received and billed the failed call, and each send counts against the key’s limits, so a blind retry can charge you twice. Meadow’s own clients (the Python client, the Go SDK, and themdwCLI) follow this rule and send any call at most 3 times. The OpenAI and Anthropic SDKs resend twice by default, also after a 5xx. See Use your existing tools.
A stream that Meadow ends during a restart carries a last error event (see Streaming). A call that had no response yet gets 503 with error.code server_restarting, retry-after, and the header x-should-retry: true when the call is safe to send again (a GET, PUT or DELETE, a route dry run, or a sandbox create or background command start sent with Idempotency-Key) and false when the work may already have happened (a model call, a blocking command, any other POST, which includes a key, project or image create). OpenAI’s SDKs obey that header.
When Meadow cannot reach its database, every route returns 503 with error.code database_unavailable, retry-after, and the same x-should-retry header. Wait for the seconds in retry-after and retry when x-should-retry is true. When it is false, the change may have been written before the connection was lost: read the resource first.
A background command start sent with Idempotency-Key can return two 409s of its own. exec_start_in_progress means another request is starting it right now: send the same request again after retry-after. exec_start_failed means the earlier start failed and nothing is running: that key can never succeed, so send the start again with a new Idempotency-Key.
A broken stream is a failed call. When a model stream breaks after its first event, Meadow ends it with one error event in the request’s format (see Streaming). Check for that event and for the format’s final event, and retry the whole call if the final event is missing.
Retry and outcome on sandbox routes
An error from a route under /v1/sandboxes carries two more fields in error. They use BoxRouter’s names and values (boxrouter.ai/docs/error-codes). They say in the body what the rules above say in prose.
completed and partial are BoxRouter values that Meadow does not send today. Treat them as unknown.
When the response has x-should-retry, retry is safe when the header is true and check_outcome when it is false. The two never disagree.
A create that fails after Meadow accepted it is not an error response. POST /v1/sandboxes returns 202, and the sandbox later has status failed and a failure_reason. Read it before you create again.
The error event that ends a broken streamed command (POST /v1/sandboxes/{sandbox_id}/exec with stream: true) carries the same two fields, always check_outcome and unknown: the command started before the stream began. That holds when Meadow ends the stream for a restart too.
Other routes, the model routes included, do not carry these fields.
retry-after
Every 429 carries a retry-after header in whole seconds.
Each server counts failed authentications on its own. Four servers answered in this run, so 80 attempts got a 401 before every server had counted its 20. With one server the 21st attempt gets the 429.
Back off from the header value and add jitter. A sample that does this for a read call:
With a valid key, then with a wrong one (project list trimmed):
Request IDs
Every response carries an x-request-id header with Meadow’s id for the request: req_ and 24 hex characters. That covers served calls, errors, streams, and unknown routes. A response Meadow did not write has no id. The hosted beta’s load balancer answers a request that is still open after 60 minutes with a 504 whose body is the text stream timeout, with no JSON and no x-request-id. The name is the one OpenAI uses, so the OpenAI SDKs read it into _request_id without changes. Every response of /v1/messages also carries the same id in a request-id header, the name the Anthropic API uses, so the Anthropic SDKs fill message._request_id and error.request_id. Every error body Meadow writes, in any of the three envelopes, repeats the id as request_id:
- A provider error that is passed through on a model route keeps the provider’s body, so there Meadow’s id is in the headers only. An Anthropic body passed through carries Anthropic’s own
request_id, which is not Meadow’s. - You can send your own id in an
X-Client-Request-Idheader, as on OpenAI: 1 to 512 printable ASCII characters, sent once. Anything else returns 400X-Client-Request-Id must be sent once and be 1 to 512 printable ASCII characters. Meadow writes it to its log beside its own id and does not send it back. - On model routes
x-meadow-provider-request-idcarries the request id of the provider that answered, for use with that provider’s support.
Report a problem
Send the x-request-id of the failed call. It finds the request in Meadow’s logs. If you do not have it, send:
- The time of the request in UTC, to the second. The
dateresponse header has it. - The method and path, such as
POST /v1/sandboxes. - The HTTP status and the full error body.
- The id of the key you used (
key_...) and its project id. Never send the key’s secret. - The IDs involved: sandbox, exec, image, or project.
- For model calls: the
x-meadow-*response headers and the model id you sent.
Leave out prompts, file contents, and provider keys. Support does not need them and Meadow does not log them.
Send reports to the support contact you were given when you joined the beta.
API reference
Operation with its own error code: createSshAccess.