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.
OpenCode Integration
Use NanoGPT with OpenCode, the open source AI coding agent for your terminal.One-Click Setup (Mac/Linux)
Run this command in your terminal:- Open your browser to authenticate with NanoGPT (or let you paste an API key)
- Configure OpenCode to use NanoGPT as your AI provider
- Set up popular models like Claude Sonnet 4.5, Claude 4.5 Opus, GPT 5.2, Gemini 3 Flash (Preview), Gemini 3 Pro, GLM 4.7
Manual Setup
If you prefer to configure manually:1. Create the auth file
Add your NanoGPT API key to~/.local/share/opencode/auth.json:
2. Create the config file
Create~/.config/opencode/.opencode.json:
Usage
After setup, start OpenCode:Switching Models
Use the/model command inside OpenCode to switch between models, or edit the model field in your .opencode.json:
Available Models
The setup script preconfigures these models:| Model ID | Description |
|---|---|
nano-gpt/claude-sonnet-4-5-20250929 | Claude Sonnet 4.5 (default) |
nano-gpt/claude-opus-4-5-20251101 | Claude 4.5 Opus |
nano-gpt/openai/gpt-5.2 | GPT 5.2 |
nano-gpt/deepseek/deepseek-v4-pro | DeepSeek V4 Pro |
nano-gpt/deepseek/deepseek-v4-pro:thinking | DeepSeek V4 Pro Thinking |
nano-gpt/deepseek/deepseek-v4-flash | DeepSeek V4 Flash |
nano-gpt/deepseek/deepseek-v4-flash:thinking | DeepSeek V4 Flash Thinking |
nano-gpt/google/gemini-3-flash-preview | Gemini 3 Flash (Preview) |
nano-gpt/gemini-3-pro-preview | Gemini 3 Pro |
nano-gpt/zai-org/glm-4.7 | GLM 4.7 |
Adding More Models
Add any of NanoGPT’s 250+ models to themodels section in your config:
GET https://nano-gpt.com/api/v1/models.
Requirements
- OpenCode installed (
curl -fsSL https://opencode.ai/install | bash) - A NanoGPT account with API access
Troubleshooting
OpenCode not finding the config? OpenCode searches for config in this order:./.opencode.json(current directory)$XDG_CONFIG_HOME/opencode/.opencode.json$HOME/.opencode.json
~/.local/share/opencode/auth.json (as an object with type and key) and that the key name matches the provider ID (nano-gpt).