In the app
Open API Keys
In the workspace sidebar, open API Keys.The page shows active and revoked keys, their mode, scopes, created time, and last-used time.
Create a key
Click Create API Key.Fill in:
| Field | Notes |
|---|---|
| Label | Optional human-readable name, max 80 characters. |
| Mode | Live or Test. Live keys start with sk_live_; test keys start with sk_test_. |
| Scopes | Select at least one scope. |
Choose scopes
Common quickstart scopes:
responses:write— create, retrieve, and cancel responsesmodels:read— list and inspect available models
files:read— read response files and file contentagents:read— list and inspect agentsagents:write— create, update, archive, and run agentsruns:read— list and inspect automation runsruns:write— control run executionenv_vars:read,env_vars:write,env_vars:reveal— manage agent environment variablesgithub:read,github:write— inspect or update GitHub connection stateapi_keys:manage— create, rotate, and revoke API keys through the API
Runtime-capable scopes
Some scopes can create or access runtime execution data. Creating or rotating a key with these scopes checks runtime billing readiness:responses:writefiles:readruns:write
Store the key locally
.env file that is ignored by Git:
Verify the key
A quick verification call usesmodels:read:
data contains active agent models for the workspace. An empty list means the key is valid but there are no active agents available to it.