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, which error bodies repeat as requestId. 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 live mode.

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. The Retry-After header tells you how many seconds to wait.

Handling errors with the SDK

The TypeScript SDK maps every error response to a typed AgentaOSError subclass with status, code, message, requestId, and (on validation) errors. A 409 becomes IdempotencyError, whatever its cause. The SDK retries a 429, a 5xx and a network error for you.

Environments

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

Support

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