Provider Setup
ByteMind supports any model provider that exposes an OpenAI-compatible API, plus Anthropic and Gemini native APIs.
Multi-Provider Setup (Model Switching)
Configure multiple providers at once and switch between them at runtime with /model:
{
"provider_runtime": {
"current_provider": "deepseek",
"default_provider": "deepseek",
"default_model": "deepseek-v4-flash",
"providers": {
"deepseek": {
"type": "openai-compatible",
"base_url": "https://api.deepseek.com",
"api_key_env": "DEEPSEEK_API_KEY",
"model": "deepseek-v4-flash",
"models": ["deepseek-v4-flash", "deepseek-v4-pro"]
},
"openai": {
"type": "openai-compatible",
"base_url": "https://api.openai.com/v1",
"api_key_env": "OPENAI_API_KEY",
"model": "gpt-5.4-mini",
"models": ["gpt-5.4-mini", "gpt-5.4"]
},
"anthropic": {
"type": "anthropic",
"base_url": "https://api.anthropic.com",
"api_key_env": "ANTHROPIC_API_KEY",
"model": "claude-sonnet-4-20250514",
"models": ["claude-sonnet-4-20250514", "claude-opus-4-20250514"]
}
}
}
}Switching models: enter /model to open an interactive picker listing all configured models across providers. Use ↑↓ to navigate and Enter to switch. The config file is updated automatically.
Quick jump
You can also jump directly with /model <provider>/<model>, e.g. /model openai/gpt-5.4.
See Config Reference for every field.
Single Provider Examples (Legacy)
{
"provider": {
"type": "openai-compatible",
"base_url": "https://api.openai.com/v1",
"model": "gpt-4o",
"api_key_env": "OPENAI_API_KEY"
}
}Any OpenAI-compatible endpoint works
If a service accepts POST /v1/chat/completions with standard OpenAI request/response format, it works with ByteMind. This includes Azure OpenAI, Groq, Together AI, and most self-hosted inference servers.
Using Environment Variables for API Keys
Always prefer api_key_env over a literal api_key in config files. This keeps secrets out of your source tree:
{ "provider": { "api_key_env": "MY_API_KEY_VAR" } }Set the variable before starting ByteMind:
# Temporary (current window only):
$env:MY_API_KEY_VAR = "sk-..."
# Permanent (survives reboots):
[Environment]::SetEnvironmentVariable("MY_API_KEY_VAR", "sk-...", "User")
# Restart terminal after this command.bytemindapi_key overrides api_key_env
If both api_key and api_key_env are set, api_key (plain text) takes priority. Remove api_key from your config to use the environment variable.
Custom Auth Headers
For providers that require non-standard authentication:
{
"provider": {
"type": "openai-compatible",
"base_url": "https://my-internal-gateway/v1",
"model": "gpt-4o",
"auth_header": "X-API-Token",
"auth_scheme": "",
"api_key_env": "GATEWAY_TOKEN"
}
}Verifying the Setup
After creating your config, run:
bytemindType a simple task like say hello and verify the model responds. If it fails, check:
base_urlis reachable from your machineapi_keyor the env var is set and validmodelID matches what the provider offers
See Troubleshooting for common auth error solutions.
See Also
- Configuration — full config reference
- Environment Variables — runtime overrides
- Troubleshooting — auth failures and connectivity issues