error code and a human-readable
message. Treat the HTTP status and error as the machine-readable contract.
Terminal errors may also include "retryable": false; do not resubmit the
same request when that field is present.
Error format
Error codes
Interpret
server_error together with its HTTP status. A 500 is an unexpected
internal failure, a 502 identifies an upstream operation failure, and a 503
is explicitly temporary and retryable.
Validation errors
400 validation_error messages name the failing field path and the violated
constraint, one path: constraint entry per issue, separated by ;. The
offending value is never echoed back.
Common scenarios
Missing API key
401 unauthorized with Invalid or missing API key.
Agent version conflict
expectedVersion.
File already exists
overwrite: true, or choose a different path.
File or directory not found
Turn already in progress
Rate limits
Per-agent user limits return a structured429 response:
resource is conversations or messages. Wait at least the integer number of
seconds in Retry-After before retrying. Handle rate_limited explicitly in
your client.
Successful operations include RateLimit-Limit, RateLimit-Remaining, and
RateLimit-Reset. See
Rate limits for configuration and counting
behavior.