Documentation Index
Fetch the complete documentation index at: https://docs.nano-gpt.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
n8n can use any OpenAI-compatible API. With NanoGPT, you get:
- One API key for 50+ models (GPT-5.2, Claude Opus 4.5, Gemini 3 Flash Preview, and more)
- The ability to switch models without changing your workflow logic
- Unified billing across providers
Prerequisites
- An n8n instance (desktop app, self-hosted, or n8n Cloud)
- A NanoGPT account and API key from nano-gpt.com/api
Step 1: Get your NanoGPT API key
- Go to nano-gpt.com/api
- Click “Create New API Key”
- Copy the key (format:
sk-nano-...)
- Store it securely, you will not be able to view it again
Step 2: Create OpenAI credentials in n8n
- Open your n8n instance
- Go to Credentials in the left sidebar
- Click + Add Credential
- Search for and select OpenAI
- Fill in the fields:
| Field | Value |
|---|
| Credential Name | NanoGPT (or any name you prefer) |
| API Key | sk-nano-YOUR-API-KEY |
| Base URL | https://nano-gpt.com/api/v1 |
- Click Save
Step 3: Use NanoGPT in a workflow
- Go to Workflows and click + New Workflow
- Add an OpenAI node or Chat OpenAI node
- In the node settings:
- Credential: Select your NanoGPT credential
- Model: Enter the model name exactly (examples below)
- Configure your prompt or messages
- Click Execute Node to test
Available models
Use any model listed on the NanoGPT pricing page. Enter the model name exactly as shown.
| Model | Provider | Best for |
|---|
openai/gpt-5.2 | OpenAI | Best overall |
anthropic/claude-opus-4.5 | Anthropic | Deep reasoning, writing |
anthropic/claude-sonnet-4.5 | Anthropic | Coding, analysis |
google/gemini-3-flash-preview | Google | Fast, cost-effective |
google/gemini-3-pro-preview | Google | Long context, reasoning |
zai-org/glm-4.7 | Zhipu | Open model alternative |
Example workflows
Basic chat completion
[Manual Trigger] -> [OpenAI Chat] -> [Output]
OpenAI Chat node:
- Credential: NanoGPT
- Model: openai/gpt-5.2
- Messages: User message from input
Document summarization
[Webhook] -> [HTTP Request (fetch doc)] -> [OpenAI Chat] -> [Respond to Webhook]
OpenAI Chat node:
- Model: google/gemini-3-flash-preview
- System: Summarize the following document concisely
- User: {{ $json.documentContent }}
Multi-model comparison
[Input] -> [OpenAI Chat (GPT-4o)] -\
-> [Merge] -> [Compare Results]
[Input] -> [OpenAI Chat (Claude)] -/
Troubleshooting
| Issue | Solution |
|---|
401 Unauthorized | Verify the API key and that your account has credits |
Invalid API Key | Ensure there are no extra spaces when copying the key |
Model not found | Double-check the model name on the pricing page |
Connection timeout | Confirm the Base URL is https://nano-gpt.com/api/v1 |
Rate limited | Add a delay between requests or upgrade your plan |
Advanced: HTTP Request node
If you need full control over parameters, use the HTTP Request node:
- Add HTTP Request
- Set:
- Method:
POST
- URL:
https://nano-gpt.com/api/v1/chat/completions
- Authentication: Header Auth
- Header Name:
Authorization
- Header Value:
Bearer sk-nano-YOUR-API-KEY
- Body Content Type: JSON
- Body:
{
"model": "openai/gpt-5.2",
"messages": [
{ "role": "user", "content": "{{ $json.prompt }}" }
]
}