Errors and rate limits
The error format, what each status means for an API key, and how many requests a key can make.
Error format
Errors are JSON with a stable, machine-readable code and a message you can show to people:
{
"defined": true,
"code": "FORBIDDEN",
"status": 403,
"message": "This key needs workflows:run."
}400 BAD_REQUESTaddsdata.issues: one entry per failed check, with itspathandmessage.- Some errors add
datawith details, such asRUN_REFUSEDandPRICE_CHANGED. Each endpoint's reference page lists the errors it can return. definedistruefor documented errors andfalsefor unexpected ones.
Status codes
| Status | Code | What it means for a key |
|---|---|---|
400 | BAD_REQUEST | The input failed validation. Fix the fields in data.issues. |
401 | UNAUTHORIZED | No key, an unknown, revoked or expired key, a call from outside the key's IP allowlist, or a key over its rate limit. |
402 | OUT_OF_CREDITS | The workspace can't pay for this. Nothing ran. See Credits. |
403 | FORBIDDEN | The key is valid but lacks the scope this endpoint needs. The message names it: This key needs generations:submit. |
404 | NOT_FOUND | The thing doesn't exist or belongs to another workspace, or the route isn't one keys can call (workspace admin, billing and the like). |
409 | CONFLICT, RUN_REFUSED, PRICE_CHANGED | The request clashes with the current state: a reused idempotency key, a run that can't start (data.code says why), or prices that rose since your estimate. |
500 | INTERNAL_SERVER_ERROR | Something broke on our side. Safe to retry. |
403 or 404?
A key gets 403 when the endpoint is part of the public API but the key's scopes don't cover it. Add the scope (Settings → API keys → Edit) or use another key.
A key gets 404 for routes outside the public API, whatever its scopes, the same answer as for a route that doesn't exist. Those routes are only for people signed in to the app.
Rate limits
Each key can make 600 requests per 60 seconds. Past that, its requests are refused until the window moves on. Today that refusal is 401 UNAUTHORIZED, the same as an invalid key, so if a key that just worked gets a 401, wait a few seconds before retrying.
To stay under the limit:
- Poll every few seconds, not in a tight loop. Clip jobs suggest about 5 seconds.
- Stream progress where you can (
GET /clip-jobs/{jobId}/events,GET /workflows/{workflowId}/events), or use webhooks. - Use separate keys for separate integrations. Each key has its own limit.
Retrying
- Retry
500s and network errors with backoff, and send anIdempotency-KeyonPOSTs so a retry never runs twice. - Don't retry
400,402,403or404unchanged: they'll fail the same way.