On this page
To use open models in Aider, set OPENAI_API_BASE and OPENAI_API_KEY to your host’s values and run aider --model openai/<model-id>. In Continue, add a model with provider: openai and an apiBase to ~/.continue/config.yaml. DeepSeek V4.1 Flash is cheapest on NanoGPT at $0.039 in, $0.40 out per million tokens. Boost is the flat-price pre-order.
Pick a host and copy three values
Every OpenAI-compatible host gives you the same three things: a base URL, a key and a model ID. Aider and Continue need nothing else. Prices are per million tokens, input / output, linked to each host’s pricing page.
| Host | Base URL | Model IDs | DeepSeek V4.1 Flash | Qwen3.8-27B |
|---|---|---|---|---|
| NanoGPT | https://api.nano-gpt.com/api/v1 |
deepseek/deepseek-v4.1-flash, qwen/qwen3.8-27b |
$0.039 / $0.40 | $0.15 / $0.70 |
| DeepInfra | https://api.deepinfra.com/v1/openai |
deepseek-ai/DeepSeek-V4.1-Flash, Qwen/Qwen3.8-27B |
$0.14 / $0.42 | $0.15 / $1.875 |
| Hugging Face | https://router.huggingface.co/v1 |
deepseek-ai/DeepSeek-V4.1-Flash:cheapest, Qwen/Qwen3.8-27B:cheapest |
from $0.051 / $0.567 | from $0.04 / $1.35 |
| OpenRouter | https://openrouter.ai/api/v1 |
deepseek/deepseek-v4.1-flash, qwen/qwen3.8-27b |
$0.051 / $0.567 + 5.5% fee | $0.039 / $1.25 + 5.5% fee |
| DeepSeek API | https://api.deepseek.com |
deepseek-flash |
$0.30 / $1.20 peak | Not served |
| Off Grid AI Boost | Arrives with your key | Arrives with your key | Flat plan from $4.99 a month | Usage worth twice the price |
Base URLs are from each host’s own docs: NanoGPT, DeepInfra, Hugging Face, OpenRouter, DeepSeek. GLM-5.3 and Kimi K3.1 Pro work the same way on the hosts that serve them; their prices are on the API price index.
Use open models in Aider
These steps follow Aider’s OpenAI-compatible API docs.
- Install Aider.
python -m pip install aider-install
aider-install
- Point it at your host. On Mac or Linux, for NanoGPT:
export OPENAI_API_BASE=https://api.nano-gpt.com/api/v1
export OPENAI_API_KEY=<your NanoGPT key>
On Windows, use setx OPENAI_API_BASE https://api.nano-gpt.com/api/v1 and setx OPENAI_API_KEY <key>, then open a new terminal, because setx only applies to new shells.
- Start Aider with the model ID behind
openai/.
cd /path/to/your/project
aider --model openai/deepseek/deepseek-v4.1-flash
The openai/ prefix tells Aider to use your base URL; everything after it is the host’s model ID. For Qwen on the same key, run aider --model openai/qwen/qwen3.8-27b. For DeepSeek’s own API, set OPENAI_API_BASE=https://api.deepseek.com and run aider --model openai/deepseek-flash.
Silence the unknown-model warning
Aider prints “Unknown context window size and costs, using sane defaults” for models it doesn’t know. Its model warnings page says you can usually ignore it. To give Aider the real limits and prices, add a .aider.model.metadata.json file in your home folder or your repo root, in the format from Aider’s advanced model settings. For DeepSeek’s API, with limits and peak prices from DeepSeek’s pricing page:
{
"openai/deepseek-flash": {
"max_input_tokens": 1000000,
"max_output_tokens": 384000,
"input_cost_per_token": 0.0000003,
"output_cost_per_token": 0.0000012,
"litellm_provider": "openai",
"mode": "chat"
}
}
The cost fields are the price per token, so $0.30 per million is 0.0000003. With them set, Aider’s cost readout matches your host.
Use open models in Continue
Continue reads its models from config.yaml. Per Continue’s configuration docs, the file lives at ~/.continue/config.yaml on Mac and Linux and %USERPROFILE%\.continue\config.yaml on Windows. To open it, press Cmd/Ctrl + L in VS Code (Cmd/Ctrl + J in JetBrains), open the configs dropdown at the top right of the chat input, and click the cog next to Local Config.
Add your models under models, using the openai provider with your host’s apiBase, as Continue’s OpenAI provider page shows:
name: My Config
version: 0.0.1
schema: v1
models:
- name: DeepSeek V4.1 Flash (NanoGPT)
provider: openai
model: deepseek/deepseek-v4.1-flash
apiBase: https://api.nano-gpt.com/api/v1
apiKey: <your NanoGPT key>
- name: Qwen3.8-27B (NanoGPT)
provider: openai
model: qwen/qwen3.8-27b
apiBase: https://api.nano-gpt.com/api/v1
apiKey: <your NanoGPT key>
Save the file and both models appear in Continue’s model picker. With no roles line, each model takes Continue’s default roles, chat, edit, apply and summarize, per the config reference. Add roles: [chat] to a model to keep it out of edits.
What it costs in a month
Say Aider or Continue sends 50M input and 10M output tokens in a month.
| Setup | Arithmetic | Month |
|---|---|---|
| DeepSeek V4.1 Flash on NanoGPT | 50 × $0.039 + 10 × $0.40 = $1.95 + $4.00 | $5.95 |
| DeepSeek V4.1 Flash on DeepInfra | 50 × $0.14 + 10 × $0.42 = $7.00 + $4.20 | $11.20 |
| Qwen3.8-27B on NanoGPT | 50 × $0.15 + 10 × $0.70 = $7.50 + $7.00 | $14.50 |
| DeepSeek API, peak | 50 × $0.30 + 10 × $1.20 = $15.00 + $12.00 | $27.00 |
| Boost Starter or Pro, cohort 1 | Flat, with usage worth $9.99 or $19.99 included, counted at each model’s token rate | $4.99 or $9.99 |
At this volume NanoGPT’s DeepSeek price is hard to beat per token. Boost wins when you want one predictable number across every model and tool you run.
Use Off Grid AI Boost in Aider and Continue
Boost gives you one OpenAI-compatible key for open models, with Qwen 3.8 and DeepSeek V4.1 Flash named. It plugs into the same spots:
# Aider
export OPENAI_API_BASE=$BOOST_BASE_URL # sent with your key in January 2027
export OPENAI_API_KEY=$BOOST_API_KEY
aider --model openai/<boost-model-id>
# Continue, ~/.continue/config.yaml
models:
- name: Boost
provider: openai
model: <boost-model-id>
apiBase: <BOOST_BASE_URL from your key email>
apiKey: <your Boost key>
The Boost base URL and model IDs aren’t published yet; they come with your key. Plans are flat: Starter $4.99, Pro $9.99 or Max $49.99 a month for cohort 1, half the regular price for as long as you stay, each with usage worth its full regular price every month. “We don’t keep your prompts or train on them.” Boost is a pre-order: your key arrives in January 2027, or you get all your money back. Until then, run Aider and Continue on NanoGPT or DeepInfra.
Not working? Symptom, check, fix
| Symptom | Check | Fix |
|---|---|---|
| Aider calls api.openai.com anyway | OPENAI_API_BASE isn’t set in this shell |
Export it again, or open a new terminal after setx on Windows |
| Aider says the model doesn’t exist | The openai/ prefix is missing, or the ID after it is wrong |
Use openai/ plus the host’s exact ID, like openai/qwen/qwen3.8-27b |
| Aider’s cost readout says $0.00 | Aider assumes unknown models are free | Add input_cost_per_token and output_cost_per_token to .aider.model.metadata.json |
| Continue doesn’t show the model | config.yaml has a YAML indentation error |
Indent each model under models: with two spaces and a dash |
| 404 from Continue | apiBase includes /chat/completions |
Use only the base URL from the table |
| 401 | The key and the base URL are from different hosts | Match the key to the host |
FAQ
How do I use an OpenAI-compatible API with Aider?
Set OPENAI_API_BASE to the host’s base URL and OPENAI_API_KEY to your key, then run aider --model openai/<model-id> from your project folder. The openai/ prefix tells Aider to send the request to your base URL.
How do I add a custom OpenAI-compatible model to Continue?
Open ~/.continue/config.yaml and add a model with provider: openai, the host’s model ID in model, its base URL in apiBase and your key in apiKey. Continue picks it up as a chat, edit and apply model by default.
Why does Aider warn about an unknown context window?
Aider doesn’t know the model’s limits or prices, so it uses defaults. You can ignore it, or add the model to .aider.model.metadata.json with its context window and per-token costs.
Which open model is cheapest in Aider or Continue? DeepSeek V4.1 Flash on NanoGPT, at $0.039 in and $0.40 out per million tokens. Qwen3.8-27B on NanoGPT is $0.15 in and $0.70 out.
Can I use Off Grid AI Boost in Aider or Continue?
Yes. Boost is OpenAI-compatible, so it uses OPENAI_API_BASE in Aider and apiBase in Continue. It’s a pre-order: your key, base URL and model IDs arrive by email in January 2027.
More setups: DeepSeek and Qwen in Cline and Roo Code, and switching any OpenAI code to open models.