Plans
Allowances may change: read the live values from the API instead of hard-coding them.
Token usage
Agents consume tokens as they run. When the period’s allowance runs out, creating a session (or messaging a finished one, which restarts it) fails with402 Payment Required. Its detail carries limit, used, and window_end. See Errors.
Response
Concurrent sessions
A session holds a slot from the moment it leavesqueued until it reaches a terminal state, including when you cancel it. Queued sessions hold no slot. See Get quota for the fields.
Response
Queued sessions
At the limit, a create doesn’t fail: it returns201 with status queued, and the session starts on its own, oldest first, as slots free up. It then follows the normal lifecycle (queued, pending, running, terminal) and fires a webhook on every transition. Set queue: false on the create body to get a 429 instead.
For batches, fire every task at once, let the platform pace them, and collect results with webhooks.