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 the rest of our 600 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://api.nano-gpt.com/api/v1",
    api_key=os.environ["NANOGPT_API_KEY"],
)

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

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

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

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

message = client.messages.create(
    model="meta/muse-spark-1.2",
    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://api.nano-gpt.com/api/v1/chat/completions \
  -H "Authorization: Bearer $NANOGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "meta/muse-spark-1.2", "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,264
Markup on text models
0%
Smallest crypto top-up
$0.10

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://api.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

    240 image, 214 video and 121 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.015 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

Gemini 4 CarbonGoogle · google/gemini-4-carbon$2.00$10.001.05M tokens
Claude Fable 5.2Anthropic · anthropic/claude-fable-5.2$8.00$40.001M tokens
Gemini 4 ArgonGoogle · google/gemini-4-argon$2.00$10.001.05M tokens
GPT 6.2 AstraOpenAI · openai/gpt-6.2-astra$8.00$40.00922K tokens
Abliterated Model Large V2Abliteration Ai · abliteration-ai/abliterated-model-large-v2$3.00$5.001M tokens

ZDRUncensored

Muse WonderMeta · meta/muse-wonder$4.00$20.001.05M tokens
GLM 5.3 Flash UncensoredZ.AI · z-ai/glm-5.3-flash-uncensored$0.20$0.801.05M tokens

ZDRUncensoredIn Pro

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

ZDR

GLM 5.3 UncensoredZ.AI · z-ai/glm-5.3-uncensored$1.25$2.251.05M tokens

ZDRUncensored

All API prices → · Ordered by NanoGPT’s combined benchmark blend.

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. Any network fee or conversion spread shows before you pay.

  • 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 →

Switching from OpenRouter: independently owned, no 5.5% credit fee

Keep your OpenAI SDK code and change one line, plus the key. Basic chat, streaming and tool calls usually move as they are. Here’s what doesn’t, so you can decide before you switch.

client = OpenAI(
    base_url="https://api.nano-gpt.com/api/v1",  # was https://openrouter.ai/api/v1
    api_key=os.environ["NANOGPT_API_KEY"],       # was OPENROUTER_API_KEY
)
const client = new OpenAI({
  baseURL: "https://api.nano-gpt.com/api/v1", // was https://openrouter.ai/api/v1
  apiKey: process.env.NANOGPT_API_KEY,        // was OPENROUTER_API_KEY
});

Create a key on the API page first. Keep it on the server.

What changes when you move from OpenRouter (checked November 7, 2026)
NanoGPTOpenRouter
Choosing a providerSame provider object; adds a markup, normally 5%No markup
Which provider served a requestNot in API responses; shown on the Usage page when availableIn every response
usage.costUSD or XNO, in usage.currency; send usage: {include: true} to wait for itIn every response, in credits
Charge lookupGET /api/v1/usage/requests/{id}, for 24 hoursGET /api/v1/generation
Prices in GET /modelsUSD per 1M tokens, with ?detailed=trueUSD per token
Prompts that are too longReturn an errorCan be compressed to fit
error.codeA string, such as model_not_supportedA number, such as 400

The migration guide has the full mapping table and the known differences.

NanoGPT vs OpenRouter vs going direct

NanoGPT, OpenRouter and provider APIs compared (checked November 7, 2026)
NanoGPTOpenRouterGoing direct
Fee on adding creditNo percentage fee on card top-ups, though tax can apply at checkout; crypto quotes show any network fee or spread before you pay5.5% with a $0.80 minimum, 5% with crypto, 8% on the Business planUsually none
Markup on tokensNone on text models; normally 5% if you choose a providerNoneList price
PaymentCard (first top-up from $1), crypto from $0.10Card, AliPay or USDCCard, one account per provider
Models1,264, 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
OwnerNanoGPT LLC, independently ownedStripe announced an agreement to acquire it on August 19, 2026Each provider

Sources: OpenRouter pricing, OpenRouter’s platform fee, Stripe’s announcement and OpenRouter’s announcement.

“Independently owned” is about who owns us, not about standing alone. NanoGPT LLC isn’t owned by a model maker, a cloud provider or a payment company. We don’t run models ourselves: requests go to third-party hosts and intermediaries, as our privacy policy explains, and card payments go through Stripe. OpenRouter says it will keep operating as it is after joining Stripe.

Frequently asked questions

Is it compatible with the OpenAI SDK?

Yes. Point the official OpenAI SDK (or any OpenAI-compatible client) at https://api.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://api.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 many models. NanoGPT charges no percentage fee on card top-ups, takes crypto from $0.10 with no email, has dedicated endpoints for 240 image, 214 video and 121 audio models on the same key, and comes with a chat app on the same balance. OpenRouter shows which provider served each request and compresses long prompts, which NanoGPT doesn’t. The tables above list the details. OpenRouter alternatives compared.

How do I switch from OpenRouter?

Set your base URL to https://api.nano-gpt.com/api/v1 and use a NanoGPT key. All 10 models in OpenRouter’s weekly top ten had the same ID here when we checked on November 7, 2026. Before you move traffic, check your other IDs, any provider settings, and how your code reads usage.cost. Read the migration guide.

Is NanoGPT cheaper than OpenRouter?

It depends on the model. Card top-ups here carry no percentage fee, while OpenRouter’s standard fee on card purchases is 5.5%. But token prices differ in both directions, and some models cost more here even after that fee. Choosing a provider also adds a markup, normally 5%. Compare the models you use before you move traffic. See API prices.

Is there a markup?

No markup on text models: they’re billed at the model’s list price. Card top-ups carry no percentage fee, though tax can apply at checkout. Choosing one specific provider adds a markup, normally 5%. See pricing.

Which models are available?

All of them: 1,264 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?

Not by default. NanoGPT doesn’t store your text prompts or replies. Billing keeps usage records such as the model, tokens and cost. Two exceptions: if a provider returns an error quoting part of a request, it can reach our server logs (ZDR requests scrub it), and image and video prompts are saved with your history unless you turn that off. 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?

There’s no single global limit: limits depend on the endpoint and how a request is billed. Requests covered by the Pro subscription can run 16 at once and 60 a minute per account; switch on pay-as-you-go overflow to run the rest from your balance. Pay-as-you-go requests aren’t held to those, and endpoint limits are in the docs. For sustained high volume, contact 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, 1,264 models, no markup on text.