Reference
Errors and limits
Every error is JSON with a message written to be shown to a person.
Error format
The Model API returns errors in the format of the wire you called, so SDKs raise their usual exceptions.
{
"error": {
"message": "Not enough credits for this request. Add credits under Billing, or lower max_tokens.",
"type": "insufficient_credits",
"code": "insufficient_credits"
}
}{
"type": "error",
"error": { "type": "rate_limit_exceeded", "message": "Too many requests. Slow down and retry in a moment." }
}{
"error": "staging.example.com isn't a verified domain in this workspace. Verify it under Domains first; agents can only reach sites you have proven you own."
}Status codes
| Status | Type (Model API) | What to do |
|---|---|---|
| 400 | invalid_request_error | The request is malformed or not allowed. The message names the field. Fix it; don't retry as is. |
| 401 | invalid_api_key | Missing, unknown or revoked key. |
| 402 | insufficient_credits | Your balance can't cover the request or the swarm's budget. Add credits or lower max_tokens / budget_usd. Nothing was charged. |
| 404 | model_not_found | Unknown model, or a swarm or file that doesn't exist. The message lists the models available. |
| 429 | rate_limit_exceeded | Too many requests, or the model is busy. Wait a moment and retry with backoff. Nothing was charged. |
| 502 | upstream_error | The model provider failed after failover. Retry. Nothing was charged. |
| 503 | service_unavailable | The model is not available right now. |
Swarm API errors carry the message only, so branch on the HTTP status. One exception to the table: asking for a swarm while 3 are already working answers 400. Wait for one to finish, then send it again.
Limits
| Limit | Value |
|---|---|
| Model API requests | 300 per minute per key |
| Request body (Model API) | 8 MB, up to 2,000 messages |
| API keys per workspace | 50 |
| Swarms working at once | 3 per workspace (paused and awaiting-approval swarms don't count) |
| Swarm budgets per key | $500 committed per 24 hours |
| Swarm budget | $1 to $100,000 |
| Swarm task | 8,000 characters |
| Swarm deadline | 5 minutes to 48 hours |
| allow_domains | 20 verified domains |
| Paused swarm kept | 7 days |
Need more? Tell us what you are building and we will raise them.