Skip to content
Nano GPT logo
NanoGPT

NanoGPT for coding

Coding tool setup for NanoGPT

Copy-paste settings for using NanoGPT models in eight coding tools, and the results of our API tool-call test.

Setup steps checked against each tool’s docs on November 24, 2026. We have not tested them inside the tools.

EXAMPLE TOOL CALL

$ choose your tool
  Claude Code · Cline · Roo · Kilo
  Cursor · Continue · Aider · OpenCode

$ choose your model
  DeepSeek · GLM · Kimi · Claude

→ read_file({"path":"src/add.ts"})
Illustration only. See the API check results below.
Coding tools covered
8
Models tested
5
API test calls
23

Tool-call test results

We made 23 API requests across five models. They check the tool-call format only. We did not test whether the models finish coding tasks.
November 23, 2026 · API tool-call test

We tested each model with a file-reading tool, then repeated the request with streaming and after a simulated tool result. A pass required a structured read_file call with valid JSON and the requested path. We did not execute the returned tools.

23 attempts (21 below plus 2 Anthropic Messages checks): 17 valid calls and 6 HTTP 400 errors when forcing tool choice on Claude. Reported cost: $0.01669 plus 0 XNO; rejected calls returned no usage.
ModelValid calls / attemptsNotes
DeepSeek V4.1 Flash3 / 3Forced tool choice.
GLM 5.3 Flash3 / 3Always-thinking; forced tool choice.
Kimi K2.63 / 3Forced tool choice.
Claude Sonnet 5.53 / 3 auto; 0 / 3 forcedUse automatic tool choice. Forced-tool attempts returned HTTP 400.
Claude Opus 5.53 / 3 auto; 0 / 3 forcedUse automatic tool choice. Forced-tool attempts returned HTTP 400.

We used automatic routing for these tests on November 23. The sample is too small to estimate reliability. We did not test the eight clients. Each request had a 512-token output limit to keep the test cheap. Use a larger budget for coding tasks.

Claude Sonnet 5.5 also passed 2 / 2 Anthropic Messages checks, one streamed and one non-streamed. We do not have a success rate from real coding-tool traffic yet. Our logs do not record which client sent a request or whether its tool call worked.

Which model to try

Start with DeepSeek V4.1 Flash for a lower-cost option. Compare GLM 5.3 Flash or Kimi K2.6 on the same task. Try Claude Sonnet 5.5 for complex changes. Check the cost before using Opus 5.5.

A test this small cannot rank coding quality. Try the model on your own repository. Check current model prices and exact API model IDs before a long run.

The Pro plan covers only the models in its subscription model list, which does not include Claude. Set your key to Subscription only if you want uncovered calls rejected rather than charged to your balance. On chat completions, a request with explicit prompt-cache controls is billed pay-as-you-go, and that includes the cache markers OpenCode adds. See the prompt caching guide.

Set up your tool

Create a NanoGPT API key. Use an exact model ID from the API catalog. Test the setup in a scratch repository first, and keep the key out of tracked files.

Claude Code

Claude Code adds /v1/messages to the base URL, so the URL below stops at /api. Set NANOGPT_API_KEY in your shell first. If a Claude Code settings file sets the same variables, its values win over these exports. Run /status in Claude Code to check the base URL and token it is using.

export ANTHROPIC_BASE_URL="https://api.nano-gpt.com/api"
export ANTHROPIC_AUTH_TOKEN="$NANOGPT_API_KEY"
claude --model anthropic/claude-sonnet-5.5

Tool docs ↗

Cursor

We have not confirmed this in the current Cursor app. Cursor’s docs cover your own API keys for chat models under Cursor Settings → Models, but they do not mention a custom base URL. If your version has a base URL override there, enter the values below. Tab completion keeps using Cursor’s own models.

OpenAI API key: YOUR_NANOGPT_API_KEY
Override OpenAI Base URL: https://api.nano-gpt.com/api/v1
Add model: deepseek/deepseek-v4.1-flash

Tool docs ↗

Cline

In the Cline settings, set API Provider to OpenAI Compatible and enter the values below. If your Cline version lists NanoGPT as a provider, you can pick that instead.

API provider: OpenAI Compatible
Base URL: https://api.nano-gpt.com/api/v1
API Key: YOUR_NANOGPT_API_KEY
Model: deepseek/deepseek-v4.1-flash

Tool docs ↗

Roo Code

Set API Provider to OpenAI Compatible and enter the values below. Roo only works with models that return native tool calls, so pick a model that supports tools.

API provider: OpenAI Compatible
Base URL: https://api.nano-gpt.com/api/v1
API Key: YOUR_NANOGPT_API_KEY
Model: deepseek/deepseek-v4.1-flash

Tool docs ↗

Kilo Code

Open Settings → Providers, scroll down and click Custom provider. Set Provider API to OpenAI Compatible. Kilo loads the model list from the base URL, or you can add the model by hand.

Provider ID: nanogpt
Display name: NanoGPT
Provider API: OpenAI Compatible
Base URL: https://api.nano-gpt.com/api/v1
API key: YOUR_NANOGPT_API_KEY
Models: deepseek/deepseek-v4.1-flash

Tool docs ↗

Continue

Add this to ~/.continue/config.yaml and replace the key placeholder. Keep the key out of shared or committed files. The tool_use line turns on tool calls, which Agent mode needs.

name: NanoGPT
version: 1.0.0
schema: v1
models:
  - name: DeepSeek V4.1 Flash
    provider: openai
    model: deepseek/deepseek-v4.1-flash
    apiBase: https://api.nano-gpt.com/api/v1
    apiKey: YOUR_NANOGPT_API_KEY
    capabilities:
      - tool_use

Tool docs ↗

Aider

Set NANOGPT_API_KEY in your shell first. The openai/ prefix tells Aider to use an OpenAI-compatible API. Aider sends the rest of the model ID to NanoGPT. Aider may warn that it does not know the model’s context size and cost. Its docs say that warning can usually be ignored.

export OPENAI_API_BASE="https://api.nano-gpt.com/api/v1"
export OPENAI_API_KEY="$NANOGPT_API_KEY"
aider --model openai/deepseek/deepseek-v4.1-flash

Tool docs ↗

OpenCode

NanoGPT is in OpenCode’s built-in provider list. Run /connect, choose NanoGPT and paste your API key. Then run /models and pick a model, or set a default in opencode.json. Model IDs keep the full NanoGPT ID after nano-gpt/.

/connect   choose NanoGPT, paste your API key
/models    choose nano-gpt/deepseek/deepseek-v4.1-flash
{
  "$schema": "https://opencode.ai/config.json",
  "model": "nano-gpt/deepseek/deepseek-v4.1-flash"
}

Tool docs ↗

Test the connection

Ask the assistant to read a file. Check that the client executes a tool call and sends the result back to the model. The model should then continue from that result.

Then try an edit and run the relevant test with the client’s normal permissions. Retries can cost money. If a turn fails, save the model ID, request ID and time. Loading the model list does not prove that tool calls work.

Get a NanoGPT API key

Use the setup above, then try a file read before running a longer task.