Authentication and API keys
Authenticate with an API key in the request header and manage separate keys for each tool or environment.
Generation requests to /v1/chat/completions, /v1/responses, /v1/messages, /v1/images/generations, and /v1/videos require an API key. You can call GET /v1/models without a key.
Authentication headers
Send the key in either header below. All endpoints accept both forms, so use whichever your SDK sends.
| Header | Value | Common clients |
|---|---|---|
Authorization | Bearer ol_live_... | OpenAI SDK, Codex, Claude Code, cURL |
x-api-key | ol_live_... | Anthropic SDK |
If you send both headers, Authorization takes precedence. Authentication failures return the following errors.
| Cause | Response |
|---|---|
| Missing authentication header | 401 missing_token |
Key without an ol_live_ prefix, such as a key for another service | 401 invalid_token |
| Incorrect or revoked key | 401 invalid_api_key |
Manage API keys
Create and revoke keys under API keys in the dashboard.
- Keys start with
ol_live_. The full key is shown once and outerlane does not store its plaintext value. If you lose a key, create a new one and revoke the old one. - Key names can contain up to 60 characters, using letters, numbers, spaces,
_,., and-. - The active key limit varies by plan, from one on Free to 20 on Max. See Plans and credits for details.
- A revoked key stops working immediately. Requests made with that key remain in the logs.
Use separate keys for each tool or environment, such as claude-code and production, to track costs by key in Usage and Request logs.
Keep your keys secure
- Keep keys in an environment variable such as
OUTERLANE_API_KEYand out of source code and Git. - Send requests through your server to keep the key out of browser and mobile clients.
- Revoke exposed keys immediately and replace them.