Private AI

Nano GPT logo
NanoGPT
Nano GPT logo
NanoGPT
Nano GPT logo
NanoGPT
Search
 
 
 
 
All conversations

Create

Chat
Studio

Explore

Models
Pricing
AI Apps
Blog

Library

Gallery
Workspace
Usage & billing
API
Suggestions and bugs
Use cases

|

Terms

|

Privacy

|

Refunds
Usage & billing
Teams
Referrals
Presets
Settings
FAQPress & mediaBrand assetsBenchmarksNano RPCEarn crypto

API integration

One OpenAI-compatible API for 1,273 text, image, video, 3D, audio and embedding models. Create a key, point your client at the base URL, and send your first request.

Guides:

Provider routingPrompt cachingWeb search pricingReferral rules
Referrals: requests billed with provider-selection pricing or markup get no referral discount or commission.

This includes Caching mode (caching: true or a :caching suffix) and pinned providers, and can include saved preferences or routing suffixes. In Chat Completions, prompt_caching or cache_control markers can also switch models with provider selection to Caching mode. Automatic routing and automatic provider caching stay eligible.

Base URLhttps://api.nano-gpt.com/api/v1
API docs

For security teams

Abliterated models for cyber defense

Abliterated Model Large V2 and Abliterated Large Flash (based on DeepSeek V4.1 Flash) are modified to refuse less, for malware analysis, detection engineering and authorized red-team work.

For defensive or authorized work only. Our Terms of Service apply.

Set up T3 Code
Large V2Large Flash

API keys

Create a key to authenticate your API requests.

No API keys yet

Create a key with the button above, then make your first request.

Send a key as Authorization: Bearer $NANOGPT_API_KEY or x-api-key.

Scripts that only manage model presets (called as presets/<name>) or read subscription usage can use a Management API token instead, which cannot run models or spend your balance. Management API docs

Batch API

High-volume asynchronous Chat Completions and Responses API jobs.

Integrations

Connect chat apps, coding tools, agents and automation.

Make your first request

Three steps from a new key to a working call.

Works with the OpenAI SDKs and OpenAI-compatible tools such as Cursor, Cline, Roo, OpenWebUI and LiteLLM. Keep your request shape and set model to a NanoGPT text model ID.

  1. 1

    Get an API key

    Create one in the API keys section above.

  2. 2

    Store it in an environment variable

    Examples read the key from NANOGPT_API_KEY and never contain it, so they are safe to copy and share.

    export NANOGPT_API_KEY="paste-your-key-here"
  3. 3

    Send a request

    curl https://api.nano-gpt.com/api/v1/chat/completions \
      -H "Authorization: Bearer $NANOGPT_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"model":"openai/gpt-6.1-sol","messages":[{"role":"user","content":"Hello!"}]}'

    You get an OpenAI-style chat completion back; the reply is in choices[0].message.content. The request and its cost appear in Usage. To use another model, pick one from the catalog below.

Client failing on reasoning (thinking) output, as some LiteLLM versions do? Use https://api.nano-gpt.com/api/v1legacy as the base URL instead.

Use NanoGPT in your chat app

Settings for SillyTavern, Janitor AI and other chat and roleplay apps.

Your characters, lorebooks and chats stay in your app; NanoGPT runs the model. You need an API key from above. Then choose your app.

  1. Open API Connections (the plug icon at the top).
  2. Set API to Chat Completion and Chat Completion Source to NanoGPT.
  3. Paste your NanoGPT API key, click Connect, then pick a model from the list.

Model ID to start with

z-ai/glm-5.3

No NanoGPT in the source list? Update SillyTavern, or choose Custom (OpenAI-compatible) and use the base URL https://api.nano-gpt.com/api/v1.

SillyTavern setup guide, including image generation

Usage is paid from your balance, and subscription models work through the API too. Not sure which model to use? See the best models for roleplay.

Wrong address: most apps want the base URL, ending in /v1. Only apps that ask for a full endpoint, like Janitor AI, take /chat/completions on the end.

Authentication error: copy an active NanoGPT key again, without spaces before or after it.

Model not found: copy the model’s exact ID from its page under Models.

Balance error: add balance, or pick a model included in your subscription.

Still stuck? Contact support with the app name, the model ID and the error. Leave your API key out of the message.

Use NanoGPT in your coding tool

Settings for Cline, Kilo Code, OpenCode and T3 Code, plus a first task to check the connection.

Connect your editor or terminal to NanoGPT. Create a key above, then choose your coding tool. Consider a separate key with a spending limit so you can track its usage.

Open Cline settings and choose OpenAI Compatible as the API provider. Enter these values and paste your NanoGPT API key into the API key field.

Base URL

https://api.nano-gpt.com/api/v1

Model ID

openai/gpt-6.1-sol

If you use separate Plan and Act configurations, set NanoGPT in both. Start with the tool’s default generation settings.

Cline setup guide

The example uses openai/gpt-6.1-sol. Check its current pricing and your key’s billing mode before starting; browse models to choose another model that supports tools.

Verify the connection

Open a project and send this first task:

First task

Inspect this project and explain how to run its tests. Read the relevant files first. Do not edit files or run commands.

You should see file-reading tool calls followed by an explanation. Review any permission requests in your coding tool. Check Usage for the request and its charge.

Authentication error: copy an active NanoGPT key again. For OpenCode, check that NANOGPT_API_KEY is set in the same terminal before launching it. In OpenCode 2, a key saved with opencode auth login is used instead of this setting; check opencode auth list.

Model or endpoint not found: copy the exact model ID and base URL above. Do not append /chat/completions to the base URL.

Balance or limit error: check your balance, subscription allowance, and the key’s spending limits and billing mode.

Replies without reading files: check that your selected model supports tools and that your coding tool allows file access.

Still stuck? Contact support with the tool version, model ID, and request ID from Usage. Leave your API key out of the message.

Models

Browse and search our model catalog. Prefer a dedicated browser? Use /models.

Model catalog

The full searchable catalog loads when you get to it, keeping the API setup view fast.

Code examples

Recipes for privacy controls, streaming, images and video in Python, JavaScript and cURL.

Code examples

Language-specific examples load when you reach this section.

API reference

The main endpoints at a glance.

Authenticate with Authorization: Bearer $NANOGPT_API_KEY or x-api-key. The Batch API covers high-volume asynchronous jobs.

EndpointPathWhat it does
Chat completions
POST
/api/v1/chat/completions
OpenAI-compatible text generation with streaming, tools and vision.
Responses
POST
/api/v1/responses
OpenAI Responses API.
Messages
POST
/api/v1/messages
Anthropic Messages API, for clients such as Claude Code.
Models
GET
/api/v1/models
Model list. Add ?detailed=true for pricing and context limits.
Images
POST
/api/v1/images/generations
OpenAI-compatible image generation. NanoGPT's native route is POST /api/generate-image.
Video
POST
/api/generate-video
Asynchronous: returns a runId. Poll /api/generate-video/status with runId and modelSlug until it completes.
Text to speech
POST
/api/v1/audio/speech
OpenAI-compatible speech synthesis.
Speech to text
POST
/api/v1/audio/transcriptions
OpenAI-compatible transcription.
Embeddings
POST
/api/v1/embeddings
OpenAI-compatible embeddings.
Reranking
POST
/api/v1/rerank
Rank text documents against a query, returning raw relevance scores and original document indexes.
Reranking models
GET
/api/v1/rerank-models
Reranking model capabilities and prices in USD per million input tokens.

Every endpoint, parameter and error code is in the full API reference.

More ways to connect

Pay per request without an account, use MCP clients, or reach NanoGPT over Tor.

x402: pay per request, no account

Unauthenticated requests get a live 402 quote instead of needing an API key, card or pre-funded balance. Pay with Nano or Base USDC.

Try live demox402 docs

Supported endpoints answer an unauthenticated request with 402 Payment Required and payment.accepted[]. Use the quote-and-complete rails, or replay the request with X-PAYMENT when a wallet signs the payment payload. GET /api/v1/x402/endpoints lists exactly what this deployment accepts.

curl -i https://api.nano-gpt.com/api/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4.1-nano","messages":[{"role":"user","content":"Say ok"}],"stream":false}'

MCP

Connect NanoGPT to MCP clients such as Claude Code and Cursor with the Model Context Protocol.

MCP setup guide

Tor onion service

Tor

Authenticated text and image generation straight from the Tor network, with no exit relay between Tor and NanoGPT. Uses your regular API key.

The connection is authenticated and encrypted inside Tor. Onion services use http:// because Tor itself authenticates and encrypts the connection. Copy the address only from an official NanoGPT page.

Onion API base URL

http://nanogpt5wwal7shnauuilouj3gaewmk7lskqxdmxlbfz5ho4tdqeh2id.onion/api/v1

Onion image-generation URL

http://nanogpt5wwal7shnauuilouj3gaewmk7lskqxdmxlbfz5ho4tdqeh2id.onion/api/generate-image

Supported: /models, /chat/completions, /responses and /messages under /api/v1, plus /api/generate-image and its signed recovery URLs. Anonymous payments, free models, video, audio, batches, account routes and the web app are not available over Tor.

cURL through a local Tor proxy

Start Tor first. --socks5-hostname makes cURL resolve the onion address through Tor. The SOCKS port is usually 9050; use 9150 with Tor Browser's proxy.

curl --socks5-hostname 127.0.0.1:9050 \
  -X POST http://nanogpt5wwal7shnauuilouj3gaewmk7lskqxdmxlbfz5ho4tdqeh2id.onion/api/v1/chat/completions \
  -H "Authorization: Bearer $NANOGPT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.2",
    "messages": [{ "role": "user", "content": "Hello through Tor" }]
  }'