When to use BYOK
- You have negotiated pricing or credits with a provider.
- You want to use a model tier or region not available on our shared keys.
- Your compliance policy requires that API keys stay under your control.
Quick start
Pass three headers (or SDK options) alongside your normal Dedalus API key:| Header | SDK option | Description |
|---|---|---|
X-Provider | provider | Provider name (openai, anthropic, google, etc.) |
X-Provider-Key | provider_key | Your API key for that provider |
X-Provider-Model | provider_model | Model identifier at the provider (optional) |
X-Provider-Key is strictly required. If you omit X-Provider, it is inferred from the model name. If you omit X-Provider-Model, the model from the request body is used.
Examples
curl
Python SDK
TypeScript SDK
Environment variables
You can also set BYOK options via environment variables instead of passing them in code:Per-request overrides
The SDK options set defaults for every request. You can also override per-request by setting the headers directly:Supported providers
Any provider in our model list works with BYOK:OpenAI
openai
Anthropic
anthropic
google
xAI
xai
Mistral
mistral
DeepSeek
deepseek
Groq
groq
Cohere
cohere
Perplexity
perplexity
Cerebras
cerebras
Together AI
together_ai
Fireworks AI
fireworks_ai
Moonshot
moonshot
How it works
Your request still goes through Dedalus. We handle routing, format normalization, streaming, and tool calling. The only difference is which API key is used for the upstream LLM call.Error handling
| Scenario | What happens |
|---|---|
| Invalid provider name | HTTP 400 with supported provider list |
| Missing or invalid provider key | Provider returns its own auth error (usually 401) |
| Model not available on provider | Provider returns its own model error (usually 404) |