Docs
Nanocoder
Nanocoder treats a remote endpoint the same way it treats Ollama: one entry under nanocoder.providers with a name, a base URL, a key and a model list. sdkProvider defaults to openai-compatible, so there is nothing else to declare.
A Custom Provider entry under nanocoder.providers in agents.config.json — name, baseUrl, apiKey, models — with no sdkProvider line needed, since it defaults to openai-compatible.
{
"nanocoder": {
"providers": [
{
"name": "Kunavo",
"baseUrl": "https://api.kunavo.com/v1",
"apiKey": "${KUNAVO_API_KEY}",
"models": ["claude-sonnet-5", "claude-haiku-4-5", "gpt-5-6-sol"]
}
]
}
}/v1 suffix. Nanocoder's docs settle this by example rather than by a rule: the field table describes baseUrl only as “API endpoint URL”, but the Custom Provider page's own example is "baseUrl": "https://my-api.example.com/v1", and every OpenAI-compatible provider page on the site does the same — https://openrouter.ai/api/v1, http://localhost:11434/v1. Drop the suffix and the failure is a 404 on the route, not a 401 on the key.sdkProvider is absent above on purpose — the field table says it “defaults to openai-compatible”, which is the wire format Kunavo answers here. The other documented values (google, anthropic, github-copilot) swap in a different SDK, and none of them is needed to reach a chat-completions endpoint.NANOCODER_PROVIDERS (or NANOCODER_PROVIDERS_FILE), then agents.config.json in the working directory, then the per-user one — ~/Library/Preferences/nanocoder/ on macOS, ~/.config/nanocoder/ on Linux, %APPDATA%\nanocoder\ on Windows. First found wins, and setting NANOCODER_CONFIG_DIR skips the project and home lookups entirely. If a key you edited is not the key being sent, that precedence is where to look.Step by step
- Create a key at
/app/keysand copy it — it is shown once. Export it asKUNAVO_API_KEYrather than pasting it into the file: Nanocoder substitutes$VAR,${VAR}and${VAR:-default}recursively through every string in a provider entry, and reads.envfrom the working directory. - Run
/settings providersinside Nanocoder and pick Custom Provider. The wizard asks, in its own order, for Provider name, Base URL, API key (optional), Model names and Request timeout, and it offers to fetch the model list from the endpoint — Kunavo answersGET /v1/models, so that fetch populates itself. - Or skip the wizard and write
agents.config.jsonyourself with the block above. Note that settings resolve file by file: a project-level file that definesnanocoder.providerssupplies that whole block, so entries in your global config are not merged in beside it. - Set a context window. Nanocoder resolves the limit from
/context-max, thencontextWindows[model], thencontextWindow, thenNANOCODER_CONTEXT_LIMIT, then models.dev — and Kunavo is not a models.dev provider, so without one of the first four it budgets against a fallback that is not your model's. The numbers are on/models. - Open
/model, choose one of the ids you listed — the picker shows them under thenameyou gave — and run something small that has to call a tool. If tool calls come back malformed on a particular model,disableToolModelsnarrows that off per model rather than per provider.
Checked against Nanocoder's Custom Provider page on September 21, 2026. Third-party settings move; if a field name here no longer matches what you see, that page is the authority, not this one.
Verify before you debug the client
One request settles whether a failure is the endpoint, the key, or the configuration file. If this returns JSON, the same base URL and key work in Nanocoder.
# Settles whether a failure is the endpoint, the key, or the client.
curl -sS https://api.kunavo.com/v1/models \
-H "Authorization: Bearer sk-kn-..."Which model id to put in the field
Every text model is reachable as a model id — the live list is GET /v1/models, and the catalog with prices is on the models page. Rates are USD per 1M tokens, input / output.
| Model id | Kunavo in / out | Where it fits in Nanocoder |
|---|---|---|
claude-sonnet-5 | $2.00 / $10.00 | the default working model for a terminal agent's edit-and-run loop |
claude-haiku-4-5 | $0.40 / $2.00 | long tool-heavy sessions, where turn count dominates the bill |
gpt-5-6-sol | $2.00 / $12.00 | a second opinion from another family on the same key |
gemini-3-8-flash | $0.525 / $2.625 | quick file triage and summarising before a real edit |
claude-opus-5 | $2.00 / $10.00 | the one hard refactor in a session, where a wrong plan is expensive |
FAQ
Does Nanocoder support a custom API endpoint?
Yes, and it is a documented first-party feature rather than an undocumented field. Nanocoder's own "Custom Provider" page states that any service exposing an OpenAI-compatible API can be added as a custom provider, and prints the object to write: name, baseUrl, apiKey and models. You can add it interactively with the /settings providers wizard or by hand in agents.config.json. That was the documentation as of September 21, 2026.
Where do I put the Nanocoder API key?
In the apiKey field of the provider entry, inside agents.config.json. Nanocoder applies environment-variable substitution recursively to string fields in provider configs, so the safer form is "apiKey": "${KUNAVO_API_KEY}" with the value exported in your shell or a .env file in the working directory. Environment overrides via NANOCODER_PROVIDERS take highest precedence, then the project-level agents.config.json, then the per-user one, so an edit that seems to have no effect is usually being shadowed further up that order.
Does the Nanocoder baseUrl need /v1 at the end?
For an OpenAI-compatible endpoint, yes — for example https://api.kunavo.com/v1. Nanocoder's documentation does not state a rule about the suffix in prose; its field table describes baseUrl only as the API endpoint URL. It settles the question by example instead: the Custom Provider page's own sample uses https://my-api.example.com/v1, and every OpenAI-compatible provider page on the site carries the same suffix. A missing /v1 surfaces as a 404 on the route rather than an authentication error.
Why does Nanocoder show no cost or the wrong context size for these models?
Because Nanocoder reads model metadata from models.dev, and a third-party gateway it does not list has no entry there. Its documented context-limit order is /context-max or --context-max, then contextWindows[model], then contextWindow, then NANOCODER_CONTEXT_LIMIT, then models.dev, so set one of the first four in the provider entry and the meter is correct again. The per-response cost figure is the client's own arithmetic over reported tokens either way — reconcile against your provider's own ledger, not against the footer.