Skip to content
Nano GPT logo
NanoGPT

OpenAI-compatible: change two lines

One API key for every model

Call Claude, GPT, Gemini, DeepSeek, GLM and hundreds more text models through one OpenAI-compatible endpoint, with image, video and audio models on the same key and balance. Keep your OpenAI SDK code; change the base URL and the key.

No markup on text models. Top up with crypto from $0.10.

  • OpenAI
  • Anthropic
  • Google
  • DeepSeek
  • Z.AI
  • Moonshot AI
  • Qwen
  • xAI
  • Meta
  • Mistral
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://nano-gpt.com/api/v1",
    api_key=os.environ["NANOGPT_API_KEY"],
)

reply = client.chat.completions.create(
    model="google/gemini-3.8-flash",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(reply.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://nano-gpt.com/api/v1",
  apiKey: process.env.NANOGPT_API_KEY,
});

const reply = await client.chat.completions.create({
  model: "google/gemini-3.8-flash",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(reply.choices[0].message.content);
import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://nano-gpt.com/api",
    api_key=os.environ["NANOGPT_API_KEY"],
)

message = client.messages.create(
    model="google/gemini-3.8-flash",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
# Reasoning models put a thinking block before the text.
print("".join(block.text for block in message.content if block.type == "text"))
curl https://nano-gpt.com/api/v1/chat/completions \
  -H "Authorization: Bearer $NANOGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "google/gemini-3.8-flash", "messages": [{"role": "user", "content": "Hello!"}]}'

The highlighted lines are the only ones that change from the OpenAI or Anthropic SDK. Keep your key on the server.

Models on one key
1,000
Markup on text models
0%
Smallest crypto top-up
$0.10
Requests per second
25/s

What is an LLM API?

An LLM API lets your code send text to a large language model and get its reply back over HTTP. An OpenAI-compatible API uses the same request format as OpenAI’s, so the same SDKs and tools work with it. NanoGPT serves every text model through that one format, so switching models means changing one string; image, video and audio models have their own documented endpoints on the same key.

Quickstart

  1. Step 1

    Create a key

    Open the API page and create a key. No email needed. Add a balance with crypto or a card.

  2. Step 2

    Change two lines

    Set the base URL to https://nano-gpt.com/api/v1 and use your NanoGPT key, as in the code above.

  3. Step 3

    Pick any model id

    List text models with GET /api/v1/models, or copy an id from the models page.

What you can build

  • Chatbots and agents

    Streaming, tool calling and structured output on every model that supports them.

    API reference →
  • Coding tools

    Plug the key into Cline, Roo Code, Kilo Code, OpenCode, Claude Code and other coding agents.

    Setup guides →
  • Roleplay frontends

    Use any model as the engine behind SillyTavern or Janitor AI.

    AI roleplay →
  • Images, video and audio

    179 image, 120 video and 56 audio models on the same key.

    Media models →

Prices of top models

10 top-ranked text models on NanoGPT, with today’s prices. Every model id works on the same endpoint. Looking for a cheap LLM API? Text models start at $0.01 per 1M input tokens.

Top-ranked models: price per 1M tokens and context length
ModelInput / 1MOutput / 1MContextTags
Claude Opus 5.5Anthropic · anthropic/claude-opus-5.5$4.00$20.001M tokens

ZDR

GPT 6 AstraOpenAI · openai/gpt-6-astra$10.00$50.001.05M tokens

ZDR

Claude Fable 5.1Anthropic · anthropic/claude-fable-5.1$10.00$50.001M tokens
Qwen3.8 Max 0902Qwen · qwen/qwen3.8-max-0902$2.00$6.00992K tokens
Muse Spark 1.3Meta · meta/muse-spark-1.3$1.25$4.251.05M tokens
Kimi K3.1 ProMoonshot AI · moonshotai/kimi-k3.1-pro$2.00$10.001.05M tokens
Kimi K3.1 Pro HighspeedMoonshot AI · moonshotai/kimi-k3.1-pro-highspeed$4.00$20.001.05M tokens
Gemini 3.8 FlashGoogle · google/gemini-3.8-flash$0.75$3.751.05M tokens
GPT 5.6 SolOpenAI · openai/gpt-5.6-sol$2.00$10.001.05M tokens

ZDR

Gemini 3.1 Pro (Preview)Google · google/gemini-3.1-pro-preview$2.00$12.001.05M tokens

All API prices → · Ordered by NanoGPT’s curated ranking.

Pay your way

Pay per token with no subscription. No email and no personal details to get a key or top up.

  • Crypto

    Top up from $0.10, credited in full.

  • Card

    First top-up from $1, then from $5, with no percentage fee.

  • Spending caps

    Daily USD and request caps per key, and monthly budgets per team member.

  • Usage by model

    The usage page shows requests, tokens and spending by model, from your billing records.

    Open usage →

NanoGPT vs OpenRouter vs going direct

NanoGPT, OpenRouter and provider APIs compared (checked October 31, 2026)
NanoGPTOpenRouterGoing direct
MarkupNone on text models; deposits credited in fullNone on models; 5.5% fee on credit purchasesList price
PaymentCard (first top-up from $1), crypto from $0.10Card or USDCCard, one account per provider
ModelsAbout 1,000, including image, video and audio600+One company’s models
SignupNo email neededAccount neededAccount, card and often verification for each provider
OpenAI-compatible Yes YesVaries by provider

Sources: OpenRouter pricing and OpenRouter’s platform fee.

Frequently asked questions

Is it compatible with the OpenAI SDK?

Yes. Point the official OpenAI SDK (or any OpenAI-compatible client) at https://nano-gpt.com/api/v1 and use your NanoGPT key. Chat completions and streaming work the same way, and tool calling and structured output work on the models that support them; you change the model name to switch models. The Responses API is served too.

Does it work with the Anthropic SDK and Claude Code?

Yes. NanoGPT also serves the Anthropic Messages API: set the Anthropic SDK’s base URL to https://nano-gpt.com/api and use your NanoGPT key. Claude Code works the same way, with ANTHROPIC_BASE_URL pointing at NanoGPT. Claude Code setup.

How is NanoGPT different from OpenRouter?

Both give you one OpenAI-compatible key for hundreds of models. NanoGPT credits deposits in full with no percentage fee, takes crypto from $0.10 with no email, has dedicated endpoints for 179 image, 120 video and 56 audio models on the same key, and comes with a chat app on the same balance. The comparison table above lists the details. OpenRouter alternatives compared.

Is there a markup?

No markup on text models: they’re billed at the model’s list price, and deposits are credited in full with no percentage fee. The only extras are opt-in, such as pinning one specific provider. See pricing.

Which models are available?

All of them: about 1,000 text, image, video and audio models on the same key. GET /api/v1/models lists the text models (add ?detailed=true for prices and context length), and /api/v1/image-models, /api/v1/video-models and /api/v1/audio-models list the rest. Browse the models.

Do you store prompts?

No. NanoGPT doesn’t log your prompts or replies. Billing keeps usage records such as the model, tokens and cost. If you want request logs for debugging, you can turn them on yourself for an API key; they’re encrypted and expire after 1 to 30 days.

Is there a subscription?

No subscription is needed: you pay per token. The optional Pro plan ($12 a month) covers open models within its 60M-token weekly allowance, through the API as well as the chat. See Pro.

Do I need an email?

No. You can create a key and top up without an email or any personal details. Crypto top-ups start at $0.10.

What are the rate limits?

25 requests per second. Higher limits are available through support. Rate limit docs.

Can I cap spending?

Yes. Each API key can have a daily cap in USD and a daily cap on requests, and teams can set a monthly USD budget for each member.

Get a key and send your first request

One key, about 1,000 models, no markup on text.