Bring your own API key
Blaze CLI can use your own API key (OpenRouter, OpenAI, …) to call LLMs. This is useful when you want to pin a specific provider or model, or have all usage and billing flow through your own API account.
The standard way to set this up is from the /model wizard.
How to set it up
-
Type
/modelin the interactive screen -
Pick ”+ Use your own API key…” at the bottom of the model list
-
Choose a preset
- OpenRouter — single API for Anthropic / OpenAI / Google and many more
- OpenAI — use the OpenAI API directly
- Ollama — local LLMs running on your machine (see Using local LLMs)
- Custom — any OpenAI-compatible endpoint
-
Fill in the form
- Nickname — a label for you to identify this endpoint (free-form). Presets pre-fill this
- Base URL — pre-filled when you pick a preset. For Custom, type your endpoint URL
- API key — the key from your provider (leave blank for Ollama)
-
Press
Enter— Blaze fetches the model list from the endpoint -
Pick a model and press
Enterto finish
After setup, the endpoint appears as a “route” in /model and you can switch to it any time. To go back to Blaze’s first-party route, pick “Blaze (subscription)” in /model.
Example: connect via OpenRouter
-
Get an OpenRouter API key: https://openrouter.ai/keys
-
In Blaze:
/model→ ”+ Use your own API key…” → “OpenRouter” -
Fill the form
- Nickname:
openrouter(keep the default) - Base URL:
https://openrouter.ai/api/v1/chat/completions(keep the default) - API key: paste your OpenRouter key
- Nickname:
-
Enter→ pick a model from the list
Example: connect via OpenAI
-
Get an OpenAI API key: https://platform.openai.com/api-keys
-
In Blaze:
/model→ ”+ Use your own API key…” → “OpenAI” -
Fill the form
- Nickname:
openai(keep the default) - Base URL:
https://api.openai.com/v1/chat/completions(keep the default) - API key: paste your OpenAI key
- Nickname:
-
Enter→ pick a model from the list
Working with the model list
The model picker supports live filtering — just start typing.
- Type any text → filters by model name
↑/↓→ move the cursorEnter→ confirmEsc→ cancel
If the list is empty or the fetch fails, Blaze drops to a screen where you can type the model name by hand.
Where API keys are stored
The API key you enter is encrypted in your OS’s secure storage (Keychain on macOS, Credential Manager on Windows). It is never written in plaintext to ~/.blaze/config.json.
Removing an endpoint
In the /model screen, move the cursor onto an endpoint and press d to delete it. The associated key is removed from secure storage at the same time.
Advanced: edit config.json directly
If the wizard does not give you enough control, you can edit ~/.blaze/config.json directly under byok_overrides to control provider order, reasoning effort, and more.
This section is for advanced users. The wizard is enough for the typical workflow.
Configuration file
~/.blaze/config.json (per environment: production = .blaze, staging = .blaze-stg, development = .blaze-dev).
Minimal example:
{
"$schema": "https://blaze.igness.ai/schema/config.json",
"selected_byok_nickname": "openrouter",
"byok_overrides": {
"openrouter": {
"provider": { "order": ["anthropic"], "allow_fallbacks": false },
"reasoning": { "effort": "high" }
}
}
}The keys under byok_overrides are the endpoint nicknames you set in the wizard. If you use multiple endpoints, each can have its own overrides.
Supported fields
provider.order
Preferred provider order as a list of strings. For example, to make OpenRouter prefer the Anthropic route:
{ "provider": { "order": ["anthropic", "openai"] } }Valid values depend on what your endpoint accepts (for OpenRouter: anthropic, openai, together, …).
provider.allow_fallbacks
Whether requests may fall back to providers outside of order when your preferred providers are unavailable.
{ "provider": { "order": ["anthropic"], "allow_fallbacks": false } }Set this to false if you want to pin cost, latency, or model quality strictly.
reasoning.effort
For models that support reasoning, controls how deeply they think.
{ "reasoning": { "effort": "high" } }One of low / medium / high. Higher values improve answer quality at the cost of latency and price.
Editor autocomplete
Add $schema at the top of the config to get autocomplete and validation in editors like VS Code:
{
"$schema": "https://blaze.igness.ai/schema/config.json"
}- Unknown keys (typos) trigger warnings
- Enum fields like
reasoning.effortbecome dropdowns
When changes take effect
Settings are loaded at Blaze startup. Quit and restart Blaze after editing.
Scope
These overrides apply only to the BYOK route. Blaze’s first-party route (via the LLM proxy) is unaffected.