Authentication
When calling the task API (/api/tasks/*), every request must include your API key in a header:
X-Api-Key: sk-live-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Requests without a key return 401 Unauthorized:
{ "message": "API key required." }
Key types
| Type | Prefix | Description |
|---|---|---|
Paid key (paid) |
sk-live- |
Uses the account's paid credits. Does not expire. |
Trial key (trial) |
sk-test- |
Uses one specific trial credit grant. Can no longer be used once the grant expires. |
Getting a key
Keys are managed on the API Keys page in the console, where you can create, reissue, or revoke them.
Paid keys: Only after at least one successful top-up can you click "Create paid key" on the "Paid keys" tab. You can check your remaining credits with the key; see Check Remaining Credits.
Trial keys: On the "Trial keys" tab, select a trial credit grant that hasn't expired and still has credits remaining, then click "Create trial key". Each trial credit grant can have only one active key at a time. Once the grant expires, the key becomes invalid along with it, and it can no longer be created or reissued.
The full key is shown immediately after it's created. You can also click "Show" in the list later to view it again.
Rate limits
| Type | Requests per minute | Requests per day |
|---|---|---|
| Paid key | 300 | 100,000 |
| Trial key | 20 | 1,000 |
Requests are counted per key, and every API call counts as one request, including task status queries. Any limits we've adjusted for you, as well as the concurrent processing limit and queue limit for each task type, can be checked with Check Usage Limits or viewed on the Dashboard.
Exceeding a limit returns 429:
{ "message": "Too Many Attempts." }
Response headers
Once a request passes key authentication, every response (including error responses) includes the two headers below, which you can use to control your request rate:
| Header | Description |
|---|---|
X-RateLimit-Limit |
The request limit. Of the per-minute and per-day limits, shows whichever has fewer requests remaining. |
X-RateLimit-Remaining |
The number of requests you can still send right now. When it reaches 0, stop and don't send any more. |
A 429 response also includes:
| Header | Description |
|---|---|
Retry-After |
How many seconds to wait before retrying. Wait this long before sending again; resending immediately will be blocked as well. |
X-RateLimit-Reset |
When you can retry (Unix timestamp, in seconds). Present only when the request limit is used up (Too Many Attempts.). |
Example:
HTTP/1.1 429 Too Many Requests
X-RateLimit-Limit: 20
X-RateLimit-Remaining: 0
Retry-After: 9
X-RateLimit-Reset: 1796027409
If you need to keep checking for task results, see No Public URL? Poll for Results for the recommended approach.