Provider Keys
Overview
Section titled “Overview”To use TokenRouter, you need to provide API keys for the AI providers you want to use. TokenRouter supports two methods:
- Console Configuration (Recommended) - Store encrypted keys in the console
- Inline Headers - Pass keys directly in requests
Supported Providers
Section titled “Supported Providers”| Provider | Models | Get API Key |
|---|---|---|
| OpenAI | GPT-4o, GPT-4 Turbo | platform.openai.com |
| Anthropic | Claude 3.7 Sonnet, Opus, Haiku | console.anthropic.com |
| Gemini 1.5 Pro, Flash | makersuite.google.com | |
| Mistral | Mistral Large, Medium | console.mistral.ai |
| DeepSeek | DeepSeek V3 | platform.deepseek.com |
| Meta | Llama 4 | llama.meta.com (special access) |
Adding Provider Keys in Console
Section titled “Adding Provider Keys in Console”- Go to Console → Providers
- Click Add Provider
- Select provider (OpenAI, Anthropic, etc.)
- Paste your API key
- Click Save
Keys are encrypted and never exposed in logs.
Inline Provider Keys
Section titled “Inline Provider Keys”Pass provider keys directly in request headers:
const response = await client.responses.create({ model: 'gpt-4o', input: 'Hello!'}, { headers: { 'X-OpenAI-Key': process.env.OPENAI_API_KEY }});response = client.responses.create( model="gpt-4o", input="Hello!", extra_headers={ "X-OpenAI-Key": os.getenv("OPENAI_API_KEY") })curl https://api.tokenrouter.io/v1/responses \ -H "Authorization: Bearer tr_..." \ -H "X-OpenAI-Key: sk-proj-..." \ -d '{"model": "gpt-4o", "input": "Hello!"}'Supported Headers
Section titled “Supported Headers”X-OpenAI-Key- OpenAIX-Anthropic-Key- AnthropicX-Gemini-Key- Google GeminiX-Mistral-Key- MistralX-DeepSeek-Key- DeepSeek