API keys
Create, scope, limit, and revoke the keys your apps use to call Respan.
A Respan API key authenticates your calls to the gateway and the Respan API, and everything sent with it is logged in the key’s project. Use one key per app and environment so you can limit or revoke each one on its own.
Create a key
Open API keys
Go to API keys and click New key. The same page is at Settings › API Keys.
Choose the environment and permissions
Name the key, pick an environment, and choose its permissions. Then click Create.


Copy the key
Click Copy, then Done. You won’t see the key again, so save it now:
export RESPAN_API_KEY="your-respan-api-key"Treat a key like a password. Keep it out of source control and client-side code. If a key leaks, revoke it and create a new one.
Environment
Production and Test keep data apart. Logs, dashboards, and other data pages have an environment switch that shows Production, Test, or All environments. Spans and gateway requests sent with a test key, and Playground runs, show under Test. Your project’s first key defaults to Test.
Permissions
| Permission | Allows |
|---|---|
| Read | Viewing project data. |
| Write | Creating, editing, and deleting project data. Includes Read. |
| Gateway | Sending requests through the gateway. |
| Admin | Managing API keys and limits. |
New keys get Read, Write, and Gateway. Pick at least one permission.
Find and tag keys
The list shows each key’s prefix, tags, last use, expiry, spend, limits, status, and environment.
- Tag a key: hover the row and click Add tag. Click Tags at the top to create or edit tags.
- Find a key: search by name, or filter and sort the list.
- Copy a prefix: click the prefix under the key’s name.
Keys created with the Temporary API keys endpoint show a Temporary tag.
Edit a key
Click a key in the list to open it. Change what you need, click Save, and confirm the changes. Preview shows or hides the key’s prefix, creator, last use, and activity.
Below Permissions, set the key’s spend and usage caps, expiry, and alerts. See Limits.
Revoke a key
Open the key and click Revoke key, or open the row’s ⋯ menu in the list and click Revoke key. Click Confirm. Requests that use the key are rejected right away.
To replace a key without downtime, create the new key first, deploy it, and check that new requests show up in Logs. Then revoke the old key.
Create keys with the API
Use the Temporary API keys endpoint to create short-lived keys, for example one per contractor or demo. The key you call it with needs the Admin permission. Each new key gets the calling key’s permissions unless you set permissions_override, and it can’t get more than the calling key has.
curl https://api.respan.ai/api/temporary-keys/ \
-H "Authorization: Bearer $RESPAN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Contractor demo",
"is_test": true,
"expiry_date": "2026-10-14T00:00:00Z",
"spending_limit": 25,
"limit_policies": [{"metric": "cost", "period": "day", "max_value": 5}]
}'The response’s api_key is the only time you see the key. Manage its caps later with the Limit policies API.
Using your own OpenAI, Anthropic, or other provider keys? Click BYOK on the same page. See Provider keys.