Desktop app support is coming. BYOK is fully available in the CLI today. Desktop app integration (configure your key from the chat panel settings) is in active development and will be available in an upcoming release. The same providers, same pipeline, same tool execution — just configured from the desktop UI instead of the terminal.
BYOK still goes through the Trace backend. Your key travels with the request; the backend routes the model call to your provider using Trace’s EDA prompts, tool schemas, and pipeline. You get the same agentic behavior and the same local tool execution — just billed to your provider.
Supported providers
| Provider value | Keys it reads (env) | Example model IDs |
|---|---|---|
anthropic | ANTHROPIC_API_KEY | claude-sonnet-4-20250514 |
openai | OPENAI_API_KEY | gpt-4o |
gemini | GEMINI_API_KEY, GOOGLE_API_KEY | gemini-2.5-pro |
trace | — | Trace-hosted default (billed to your plan) |
Set it up
set stores the key in your OS keychain (falling back to a 0600 file) and sets that provider as active. The key is never written to the plaintext config.toml.
Switch providers
use a BYOK provider that has a stored key; otherwise the CLI tells you to set it first.
Pick a model
Check status
buildwithtrace doctor also reports your active model provider.
Remove a key
Resolution order
For any AI request, the CLI resolves the key in this order:- Environment variable (
ANTHROPIC_API_KEY/OPENAI_API_KEY/GEMINI_API_KEY/GOOGLE_API_KEY) - Keychain (or the
0600fallback file)
SDK BYOK (Python & Node)
The SDKs resolve BYOK the same way, so “set once” works from code or CI. Precedence:- Per-call args —
chat(..., llm_provider=, llm_api_key=, llm_model_id=)(Python) /chat(msg, { llmProvider, llmApiKey, llmModelId })(Node) - Environment —
TRACE_LLM_PROVIDER,TRACE_LLM_API_KEY,TRACE_LLM_MODEL - Persisted store — the Python SDK also reads the keychain
byok setconfig; the Node SDK additionally accepts constructor defaults (new Trace({ llmProvider, llmApiKey, llmModelId }))
Billing implications
- Trace-hosted (
trace) — counts against your Trace monthly budget / credits. Check withbuildwithtrace billing status. - BYOK (
anthropic/openai/gemini) — billed by your provider on your own account. Trace quota is untouched.
buildwithtrace auth login) — BYOK changes which model answers, not whether you’re authenticated to Trace.
Desktop App (Coming Soon)
The desktop app will support BYOK directly from the chat panel settings — no CLI required. The experience will be:- Open Settings → AI Provider in the chat panel
- Select your provider (Anthropic, OpenAI, Gemini)
- Enter your API key (stored securely in your OS keychain)
- Optionally set a specific model ID
Desktop BYOK is in active development. Follow the changelog for release announcements.

