Skip to main content
When a request fails, the API returns the matching HTTP status code and a JSON body describing what went wrong. Every response also carries an x-request-id header (echoed back as requestId in error bodies), include it when you contact support. The TypeScript SDK turns each response into a typed error for you, so most integrations never parse this body by hand.

Error response format

Status codes

Common scenarios

Validation (400)

message lists each problem, and errors names the offending field.

Authentication (401)

The x-api-key header is missing or the key is wrong. Check you are using the right key: sk_test_ for test mode, sk_live_ for production.

Not found (404)

The resource ID is wrong, or it belongs to a different environment. Test and live data are separate.

Rate limited (429)

Back off and retry. When present, the Retry-After header tells you how many seconds to wait.

Handling errors with the SDK

The TypeScript SDK maps every response to a typed AgentaOSError subclass with status, code, message, requestId, and (on validation) errors, and retries transient failures for you.

Environments

There is one base URL. Your key prefix selects the environment: sk_test_ uses test mode, sk_live_ uses production. See Test mode.

Need help?

Include the requestId (or the x-request-id header) from the failed response when you contact support. It lets us find the exact request instantly.