Authorization header.
Prerequisites
- A BLACKBOX account at app.blackbox.ai
- An active Pro subscription — the Agent API is a Pro feature
Getting Your API Key
1
Sign in to BLACKBOX
Go to app.blackbox.ai and sign in to your account.
2
Upgrade to Pro
The Agent API requires a Pro plan. If you are not already on Pro, visit app.blackbox.ai/pricing to upgrade.
3
Click Get an API Key
On the Agent API page at app.blackbox.ai/agent-api, click the Get an API Key button.This will automatically create and initialize your dedicated sandbox environment.
4
Create your API key from the Dashboard
Once provisioning is complete, you will be redirected to your Dashboard. From there, create an API key — this is the key you will use to authenticate all Agent API requests.
sk-xxxxxxxxxxxxxxxxxxxxxx
Using the API Key
Pass your API key as aBearer token in the Authorization header on every request:
Example Request
Environment Variable (Recommended)
Store your key in a.env file and load it with your preferred tool (dotenv, direnv, etc.):
.env
Python
Authentication Errors
401 — Unauthorized
- The
Authorizationheader is present and formatted asBearer <key> - The key starts with
sk-and was copied in full - The key has not been revoked from your dashboard
403 — Forbidden
Rotating Your API Key
To rotate a compromised key:- Go to app.blackbox.ai/dashboard
- Delete the old key
- Generate a new key
- Update your environment variables and redeploy
Deleting a key immediately invalidates it. Any in-flight requests using the old key will receive a
401 response.Rotating Your API Key
To rotate a compromised key:- Go to app.blackbox.ai/dashboard
- Delete the old key
- Generate a new key
- Update your environment variables and redeploy
Deleting a key immediately invalidates it. Any in-flight requests using the old key will receive a
401 response.