Skip to main content

Error envelope

Every non-2xx response has the same shape:
The HTTP status code carries the class of failure; the error string is a human-readable hint. Don’t pattern-match on the message text; it’s free-form and may change. Branch on the status code instead.

Status code reference

When to retry

A minimal retry helper:
Python
A 5xx or a timeout on POST /v1/agents/{agent_id}/run can mean “the request reached us, then the connection died”, so a blind retry can start a second run. Send an Idempotency-Key header (a fresh UUID per run) and reuse it on every retry of that run: for 24 hours the same request under the same key returns the task the first one created, with Idempotent-Replayed: true, instead of starting another. A 409 means the first request is still creating its task; retry after Retry-After. A 422 means the key was already used with a different request.
Python

Pagination

List endpoints (GET /v1/tasks, GET /v1/agents, GET /v1/agents/{id}/versions) are cursor-paginated, newest-first. The response looks like:
To fetch the next page, pass that cursor back unchanged as the cursor query parameter. When you reach the end, next_cursor is omitted (or empty).
Python

Cursor opacity

next_cursor is opaque; don’t try to parse it. If you decode it today and rely on the shape, your code will break the next time the server changes its pagination key.

limit

Default is 20, max is 100. Larger pages mean fewer round-trips but a larger response body; for bulk export, 100 is usually the right choice.

Rate limits

Rate limits are enforced per-workspace, not per-key. If you’re running tight loops or fanning out many concurrent agents, watch for 429 and back off. We do not currently publish per-tier numbers. If you’re hitting limits in production, reach out.