Errors and Rate Limits
Errors use OpenAI’s envelope on both endpoints, so error handling written against the OpenAI SDK works unchanged:
type is one of invalid_request_error, authentication_error,
permission_error, rate_limit_error or server_error. code is the stable
machine-readable value to branch on; message is for humans and may change.
A 402 for a blocked account uses its own shape, carrying message, code and
data.reason at the top level rather than inside error. Branch on the status
code before reading error, so a blocked account surfaces as the billing problem
it is rather than as a parsing failure.
What to do with each status
Retry 429, 500 and 502 with exponential backoff and jitter, and give up
after a small number of attempts rather than retrying indefinitely. A 4xx other
than 429 will return the same result however many times you send it.
Creating a response is not idempotent. If a POST /v1/responses times out on
your side, the run may still have started, so retrying can produce a second
run. Prefer "background": true for long work: it returns an id immediately,
and you poll for the outcome instead of holding a request open.
Errors worth knowing about
These come from specific combinations rather than from a malformed body, so they are easy to hit while everything looks correct:
Failures inside a stream
A stream can fail after it has started, so a 200 on the initial request is not
the whole story.
On /v1/chat/completions, read finish_reason on every chunk rather than
assuming the stream ended cleanly, and treat a connection that drops before
data: [DONE] as an incomplete reply. See Chat Completions
API.
On /v1/responses, a failed run ends with a response.failed event and a run
that stopped early ends with response.incomplete. Both are terminal, so
receiving either means no more events are coming. See Responses
API.
Planner mode has its own partial failures: an agent can be slow, refuse, or not reply. The planner treats those as normal and works around them, so a run that lost an agent still returns an answer.
Rate limits
A 429 means your plan’s limit is exhausted rather than that anything is wrong
with the request. Back off and retry.
Limits are scoped to your plan and are visible in your ASI:One account.
Next steps
- Chat Completions API - The default endpoint, including streaming
- Responses API - Retrieve, chain and cancel by id
- OpenAI Compatibility - Which parameters are supported on each endpoint
- API Reference - Every status code each endpoint returns