One OpenAI-compatible API for 1,279 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 rulesThis 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.
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.
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.
Get an API key
Create one in the API keys section above.
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"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 model list and copy its API name. Full quickstart in the docs.
Client failing on reasoning (thinking) output, as some LiteLLM versions do? Use https://api.nano-gpt.com/api/v1legacy as the base URL instead.
Everything past the first request: every model and its API name, code examples and the full reference.
Search every model with its API name, context length and price, then paste the API name into your request.
Python, JavaScript and cURL for text with streaming, images and video.
Guides, every endpoint and its parameters, and the management API.
Settings for SillyTavern, Janitor AI and other chat and roleplay apps.
Your characters, lorebooks and chats stay in your app; Cake AI runs the model. You need an API key from above. Then choose your app.
Base URL
https://cake.nano-gpt.com/api/v1Model ID to start with
z-ai/glm-5.3Use the custom source with the base URL above so requests use your Cake AI account.
SillyTavern setup guide, including image generationUsage is paid from your balance. Not sure which model to use? See the available text models.
Settings for Cline, Kilo Code, OpenCode, Claude Code, Codex CLI 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://cake.nano-gpt.com/api/v1Model ID
openai/gpt-6.1-solIf you use separate Plan and Act configurations, set NanoGPT in both. Start with the tool’s default generation settings.
Cline setup guideThe 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.
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.
/api/v1/chat/completionsOpenAI-compatible text generation with streaming, tools and vision./api/v1/images/generationsOpenAI-compatible image generation. NanoGPT's native route is POST /api/generate-image./api/generate-videoAsynchronous: returns a runId. Poll /api/generate-video/status with runId and modelSlug until it completes./api/v1/audio/speechOpenAI-compatible speech synthesis./api/v1/audio/transcriptionsOpenAI-compatible transcription./api/v1/embeddingsOpenAI-compatible embeddings./api/v1/rerankRank text documents against a query, returning raw relevance scores and original document indexes./api/v1/rerank-modelsReranking model capabilities and prices in USD per million input tokens.Every endpoint, parameter and error code is in the full API reference.
Use MCP clients, or reach NanoGPT over Tor.
Connect NanoGPT to MCP clients such as Claude Code and Cursor with the Model Context Protocol.
Authenticated text and image generation straight from the Tor network, with no exit relay between Tor and NanoGPT. Uses your regular API key.