Skip to main content

API Keys

All TokenLab API requests require an API key. For OpenAI-compatible endpoints, send it as:
For Anthropic-compatible /v1/messages requests, you can also use:

Management Tokens

Management API endpoints use a separate token type:
Use management tokens only with /v1/management/* endpoints. Create them on the Settings page in Console. The full token is shown only once when you generate or rotate it.
Management tokens cannot be used for model inference, and standard sk-... API keys cannot be used for the Management API.

Get an API key

  1. Sign in to TokenLab Console
  2. Open API Keys
  3. Create a new key
  4. Give it a descriptive name
  5. Copy it immediately because it is shown only once
  • Never expose API keys in client-side code
  • Never commit API keys to version control
  • Use environment variables or a secret manager
  • Rotate keys periodically
  • Delete unused keys

Use an API key

Set a usage limit

You can set a usage limit on each API key:

Key prefix

All TokenLab API keys start with sk-.

Anthropic Compatibility

For the /v1/messages endpoint, the Anthropic-style header works as expected:
Use Authorization: Bearer ... with OpenAI-compatible APIs such as /v1/responses, /v1/chat/completions, and /v1/models.

Error Responses

Example: