Models and cost
Using your own API keys
Bring any provider. Turns bill to your key, cost nothing in credits, and keep every memory feature.
You don't have to use the managed models. Point ContextCode at any provider you have a key for, and those turns bill to you instead of to credits.
Memory, grounding, search, and every other feature work exactly the same either way. Bringing your own key changes who pays for the inference, nothing else.
Named providers
These need nothing but a key:
groq · deepseek · together · fireworks · mistral · perplexity ·
moonshot · cerebras · xai · google · openrouter · ollama
// ~/.contextcode/settings.json
{
"providers": {
"anthropic": { "api_key_env": "ANTHROPIC_API_KEY" },
"groq": { "api_key_env": "GROQ_API_KEY", "model": "llama-4-maverick" },
"ollama": { "base_url": "http://localhost:11434", "model": "qwen3-coder" }
}
}azure additionally needs your resource base_url.
Anything else
Any OpenAI-compatible, Anthropic-shaped, or Gemini-shaped endpoint works with a
base_url and an api shape — including a model you're hosting yourself:
{
"providers": {
"my-vllm": {
"base_url": "http://gpu-box:8000",
"api_key": "…",
"model": "qwen3-coder-32b"
}
}
}Using one
/model groq/llama-4-maverick
/model my-vllm/qwen3-coder-32bCtrlM lists your configured providers next to the managed tiers, so you can see both and pick.
Keys in environment variables
api_key_env names a variable rather than storing the key in the file. Use it
— a settings file gets committed by accident far more often than a shell
profile does.
A fallback key
anthropic_fallback_key is tried directly when the primary managed path for an
Anthropic-intended stage is exhausted, before falling back to another model
family. anthropic_fallback_key_env names a variable instead, and the
CONTEXTCODE_ANTHROPIC_FALLBACK_KEY environment variable wins over both.
What isn't supported yet
Bedrock and Vertex signed transports. Use those providers' OpenAI-compatible endpoints if they offer one, or run through a gateway.
If it doesn't work
The provider isn't in the picker. The key is missing or the named variable
is empty. csc doctor checks what resolved.
Turns still cost credits. Model pins are per session. Check the status line — it names the active model and where it's billing.
A local model is failing on long turns. Small context windows truncate. Raise the model's context length, or pin a larger model for planning and the local one for edits.