Skip to main content
Send an API key with every request, as a bearer token:
A request without a valid key gets 401 with the code unauthenticated. Create and manage keys in the dashboard, under API keys. A key belongs to an organization. Every task it creates is charged to that organization’s balance.
The dashboard shows a key once, when you create it. Keep it on your server. Never put it in a browser or a mobile app.

Live and test keys

Build and test your integration with a test key. Then change the key. The code stays the same: a test result has the same shape as a live one. In the sandbox, the prompt controls the outcome:
  • [fail] in the prompt: the task fails.
  • [slow] in the prompt: the task takes about 2 minutes.
  • Any other prompt: the task completes in about 15 seconds.

Budgets

A key can have a total budget, a monthly budget, or both. A task that would go over the budget is refused with 403 and the code key_budget_exceeded:
Give each app or environment its own key with a budget. A bug in one then cannot spend the whole balance.

Rotation

Rotate a key in the dashboard to get a new secret. The old secret keeps working for 24 hours, so you can deploy the new one without downtime. After 24 hours, the old secret gets 401. Revoke a key to stop it at once.