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)
Thex-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. TheRetry-After header tells you how many seconds to wait.
Handling errors with the SDK
The TypeScript SDK maps every error response to a typedAgentaOSError 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 therequestId (or the x-request-id header) from the failed response when you contact support. It lets us find the exact request.