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.
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 with403 and the code key_budget_exceeded:
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 gets401.
Revoke a key to stop it at once.