Authentication
Every API request is authenticated with a secret key sent as a bearer token. Keys belong to a project and its dashboard.
Base URL#
All requests use HTTPS and JSON bodies (Content-Type: application/json).
API keys#
Keys are created in Settings → API keys. A key starts with sw_live_ and is displayed once, at creation: store it immediately in your secret manager or environment.
API keys open at launch. Join the waitlist to get yours first.
Sending the key#
Send the key in the Authorization header of every request:
A missing, malformed or revoked key returns 401 with the code invalid_api_key. See Errors and limits.
The Agent SDK uses the same keys. It reads them from CONTEXTWAISE_API_KEY, or from the apiKey option.
Rotating and revoking#
To rotate a key without downtime:
- Create a new key in the dashboard.
- Deploy it to your environment.
- Revoke the old key once traffic has moved over.
Revocation takes effect immediately. If you use a fail-open helper, requests made with a revoked key keep working, just without optimization.