Providers
nca supports five LLM provider backends. You can switch between them at any time via config, environment variables, or the interactive /connect and /provider commands.
Supported Providers
| Provider | Default Model | API Style | Description |
|---|---|---|---|
| MiniMax | MiniMax-M2.7 | Anthropic-compatible | Primary provider. Uses the MiniMax Anthropic-compatible endpoint. |
| Anthropic | claude-3-7-sonnet-latest | Native Anthropic | Direct Anthropic API for Claude models. |
| OpenAI | gpt-4o-mini | OpenAI Chat | Standard OpenAI chat completions API. |
| OpenRouter | openai/gpt-4o-mini | OpenAI-compatible | Aggregator providing access to 100+ models from multiple providers. |
| Custom | custom-model | OpenAI-compatible or Anthropic-compatible | Bring your own endpoint and choose the wire protocol. |
MiniMax (Default)
MiniMax is nca’s primary provider, using an Anthropic-compatible API endpoint.
Setup
export MINIMAX_API_KEY="your-minimax-api-key"
Or in config:
# ~/.local/share/ncacli/config.toml
[provider]
default = "minimax"
[provider.minimax]
api_key = "your-key"
base_url = "https://api.minimax.io/anthropic"
model = "MiniMax-M2.7"
temperature = 0.7
Features
- Anthropic-compatible protocol (
/v1/messagesendpoint) - Extended thinking support
- Native vision/image processing
- Streaming responses
Anthropic
Direct access to Claude models via the native Anthropic API.
Setup
export ANTHROPIC_API_KEY="your-anthropic-key"
[provider]
default = "anthropic"
[provider.anthropic]
api_key_env = "ANTHROPIC_API_KEY"
base_url = "https://api.anthropic.com"
model = "claude-3-7-sonnet-latest"
temperature = 1.0
OpenAI
Standard OpenAI chat completions API.
Setup
export OPENAI_API_KEY="your-openai-key"
[provider]
default = "openai"
[provider.openai]
api_key_env = "OPENAI_API_KEY"
base_url = "https://api.openai.com"
model = "gpt-4o-mini"
temperature = 0.7
OpenAI-Compatible Endpoints
You can point the OpenAI provider at any OpenAI-compatible API by changing base_url:
[provider.openai]
base_url = "https://my-local-llm:8080"
model = "local-model"
OpenRouter
Access to hundreds of models from multiple providers through a single API key.
Setup
export OPENROUTER_API_KEY="your-openrouter-key"
[provider]
default = "openrouter"
[provider.openrouter]
api_key_env = "OPENROUTER_API_KEY"
base_url = "https://openrouter.ai/api"
model = "openai/gpt-4o-mini"
temperature = 0.7
site_url = "https://my-app.com" # Optional
app_name = "my-app" # Optional
Model Format
OpenRouter uses provider/model naming:
openai/gpt-4o
anthropic/claude-3-7-sonnet
google/gemini-2.0-flash
meta-llama/llama-3.1-70b-instruct
Custom Provider
Use the custom provider when you want nca to talk to a non-built-in endpoint such as a self-hosted gateway or a third-party OpenAI-compatible / Anthropic-compatible service.
Setup
[provider]
default = "custom"
[provider.custom]
compatibility = "openai" # or "anthropic"
base_url = "https://sumopod.example"
api_key_env = "CUSTOM_PROVIDER_API_KEY"
model = "my-model"
temperature = 0.7
Environment variables:
export CUSTOM_PROVIDER_API_KEY="your-key"
export CUSTOM_PROVIDER_BASE_URL="https://sumopod.example"
export CUSTOM_PROVIDER_MODEL="my-model"
export CUSTOM_PROVIDER_COMPATIBILITY="openai"
Interactive Setup
TUI wizard — run /provider, scroll to “Add custom provider…”, and follow the guided steps.
Slash command:
/custom openai https://sumopod.example your-key my-model
/custom anthropic https://my-gateway.example your-key my-model
Notes:
compatibility = "openai"uses/v1/chat/completionsandGET /v1/modelscompatibility = "anthropic"uses/v1/messageswithx-api-keyheader- After setup, use
/model <name>to switch the configured custom model - Press
cin the provider picker for a quick-reference help card
Switching Providers
Via CLI Flag
nca --model "claude-3-7-sonnet-latest"
Via Environment Variable
NCA_DEFAULT_PROVIDER=anthropic nca
NCA_MODEL=gpt-4o nca
Via Interactive Commands
/connect # Opens provider picker UI
/provider openai # Switch default provider
/provider custom # Use the configured custom endpoint
/provider # TUI picker — select "Add custom provider…" to configure
/custom openai https://sumopod.example your-key my-model
/model gpt-4o # Switch model
/models # Browse available models
Via Config
[provider]
default = "anthropic"
Model Aliases
nca ships with built-in model aliases for quick switching:
| Alias | Resolves To |
|---|---|
default | MiniMax-M2.7 |
minimax | MiniMax-M2.7 |
m2.7 | MiniMax-M2.7 |
coding | MiniMax-M2.7 |
reasoning | MiniMax-M2.7 |
openai | gpt-4o-mini |
gpt4o | gpt-4o |
claude | claude-3-7-sonnet-latest |
openrouter | openai/gpt-4o-mini |
Add custom aliases in config:
[model.aliases]
fast = "gpt-4o-mini"
smart = "claude-3-7-sonnet-latest"
local = "ollama/llama3"
Use aliases anywhere a model name is expected:
nca --model fast
/model smart
API Key Resolution
For each provider, the API key is resolved in this order:
api_keyfield in config (not recommended for security)api_key_env— read from the named environment variable (default and recommended)
The default environment variable names are:
| Provider | Variable |
|---|---|
| MiniMax | MINIMAX_API_KEY |
| Anthropic | ANTHROPIC_API_KEY |
| OpenAI | OPENAI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Custom | CUSTOM_PROVIDER_API_KEY |
You can change the environment variable name via api_key_env in config.
Extended Thinking
Some models support extended thinking (chain-of-thought reasoning). Enable it with:
nca -t # Enable with default budget (5120 tokens)
nca -t --thinking-budget 10000 # Custom budget
Or in config:
[model]
enable_thinking = true
thinking_budget = 10000
Toggle visibility in an interactive session:
/thinking
Context Window Management
nca auto-detects context window sizes by querying the provider’s model API. This enables automatic context compaction when the conversation gets too long.
[memory.context]
auto_detect_context_window = true
query_provider_models_api = true
max_retained_messages = 50
auto_summarize_threshold = 75 # Trigger at 75% of context window
enable_auto_summarize = true
Disable provider API queries if needed:
export NCA_SKIP_CONTEXT_API=1