Claude Code · Facts verified 2026-10-13

How do I use NanoGPT with Claude Code?

Set ANTHROPIC_BASE_URL to https://nano-gpt.com/api/v1 and ANTHROPIC_AUTH_TOKEN to your NanoGPT key; NanoGPT serves the Anthropic Messages API there. Claude bills pay-as-you-go at list price, and included open-weight models can use the $12 PRO allowance.

settings.jsonnano-gpt.com
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_NANOGPT_API_KEY",
    "ANTHROPIC_BASE_URL": "https://nano-gpt.com/api/v1",
    "API_TIMEOUT_MS": "600000",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "anthropic/claude-opus-5.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "anthropic/claude-sonnet-5.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "anthropic/claude-haiku-latest"
  }
}

NanoGPT recommends the api.nano-gpt.com host for larger requests or longer runtimes. To use the PRO allowance, set the model variables to an included open-weight model instead of Claude. Run /status in Claude Code to check the base URL.

Which models cost what

Included models cost nothing extra until the weekly allowance runs out, which is why NanoGPT suits Claude Code on open-weight models. Claude through NanoGPT costs the same as Anthropic's list price.

Cost per 100 requests at list price, US dollars
Pay-as-you-go only
Claude Opus 5.5$10.66
Claude Sonnet 5.5$5.33
Included in PRO
GLM 5.3$5.72
MiniMax M3$1.29
DeepSeek V4 Flash$0.67
Coding-agent requests on our gateway, September 13 to October 12, 2026, averaging 133K input and 698 output tokens, 87% of input from cache, priced at each model maker's list price. Claude Code was not in the sample; its requests follow the same pattern of large cached context, so read these as relative costs.

NanoGPT pricing and the weekly allowance

Gotchas

IssueWhat happensWhat to do
Long sessionsLarge requests can time out on the default hostNanoGPT suggests https://api.nano-gpt.com/api/v1 and API_TIMEOUT_MS=600000
Cached requestsOn chat completions, cache markers move a request to pay-as-you-go; NanoGPT says not to assume the same for /v1/messagesWatch whether Claude Code requests show as subscription or paid usage in your account
2x modelsGLM 5.2, DeepSeek V4 Pro and Kimi K2.7 Code count input twice against PROPrefer a 1x model such as GLM 5.3 for long sessions
SpendPaid models draw on your balance with no cap by defaultSet a daily, weekly or monthly USD cap on the key
Tool useOpen-weight models handle Claude Code's tools less reliably than ClaudeTest a real task before switching a team

From docs.nano-gpt.com (Claude Code, prompt caching, rate limits) and NanoGPT's updates feed, October 13, 2026.

Every way to run other models in Claude Code

The catch

The cheap path here is an open-weight model inside Claude Code. That works for many tasks, but Claude Code's prompts and tools are written for Claude, so expect more retries on hard steps.

Where Standard Compute fits

Standard Compute takes the same two variables and does the mixing per request: routine steps go to efficient models and hard ones to Claude, with no weekly allowance, in a plan from $19 that stops at its budget. If GLM or DeepSeek handle all your sessions well, NanoGPT PRO at $12 is cheaper.

FAQ

Does NanoGPT support the Anthropic Messages API?

Yes. NanoGPT documents POST /v1/messages with "full Anthropic API compatibility", authenticated with a Bearer token or x-api-key, at https://nano-gpt.com/api/v1/messages.

Can I use my NanoGPT subscription in Claude Code?

For included open-weight models, yes: set ANTHROPIC_MODEL or the default model variables to one of them. Claude models are never included and bill pay-as-you-go.

Does NanoGPT work with Codex CLI?

Yes. NanoGPT documents base_url https://nano-gpt.com/api/v1 with env_key NANOGPT_API_KEY and wire_api = "responses".

Which NanoGPT model should I use in Claude Code?

NanoGPT's docs show Claude Opus 5.5, Sonnet 5.5 and Haiku in the default model variables. For the subscription, pick an included 1x model; test it on your own repository first.

Related guides