Quick start
Yuzu is compatible with the official OpenAI and Claude APIs. Every tool needs just two settings:
| Setting | Value |
|---|---|
| Base URL | https://api.yuzuapi.com (add /v1 for OpenAI format) |
| API Key | Create one in Console → API keys. It starts with sk- |
One-line install
Installs Claude Code / Codex / Gemini CLI and writes the config. Existing config is backed up as .bak. Requires Node.js.
irm https://yuzuapi.com/install.ps1 | iex
curl -fsSL https://yuzuapi.com/install.sh | bash
Script source: install.ps1 · install.sh. For manual setup, see the sections below.
Node.js setup
The CLI tools require Node.js 18 or later.
Install
Download the LTS installer from nodejs.org, or use winget:
winget install OpenJS.NodeJS.LTS
Download the LTS installer from nodejs.org, or use Homebrew:
brew install node
Verify
node -v npm -v
Any version v18 or later works. Reopen your terminal after installing.
npm mirror for China (optional)
If npm downloads are slow, switch the registry:
npm config set registry https://registry.npmmirror.com
Claude setup
Using Claude Code as the example. Other tools that support the Anthropic API work the same way.
Install Claude Code
npm install -g @anthropic-ai/claude-code
Configure
Edit ~/.claude/settings.json (on Windows: %USERPROFILE%\.claude\settings.json). Create it if it doesn't exist:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.yuzuapi.com",
"ANTHROPIC_AUTH_TOKEN": "sk-your-key"
}
}Or apply it to the current terminal only:
$env:ANTHROPIC_BASE_URL = "https://api.yuzuapi.com" $env:ANTHROPIC_AUTH_TOKEN = "sk-your-key"
export ANTHROPIC_BASE_URL="https://api.yuzuapi.com" export ANTHROPIC_AUTH_TOKEN="sk-your-key"
Run
cd your-project claude
In Claude Code, type /model to switch models and /status to check the active Base URL.
ChatGPT setup
Using OpenAI's official Codex CLI as the example.
Install Codex CLI
npm install -g @openai/codex
Configure
Edit ~/.codex/config.toml:
model_provider = "yuzu" model = "gpt-5" [model_providers.yuzu] name = "Yuzu" base_url = "https://api.yuzuapi.com/v1" env_key = "YUZU_API_KEY" wire_api = "responses"
Set the key as an environment variable (permanent; reopen your terminal afterwards):
setx YUZU_API_KEY "sk-your-key"
echo 'export YUZU_API_KEY="sk-your-key"' >> ~/.zshrc
Run
codex
Gemini setup
Using Google's official Gemini CLI as the example.
Install Gemini CLI
npm install -g @google/gemini-cli
Configure
setx GOOGLE_GEMINI_BASE_URL "https://api.yuzuapi.com" setx GEMINI_API_KEY "sk-your-key"
echo 'export GOOGLE_GEMINI_BASE_URL="https://api.yuzuapi.com"' >> ~/.zshrc echo 'export GEMINI_API_KEY="sk-your-key"' >> ~/.zshrc
Run
Reopen your terminal, then run it. On first launch, choose Use Gemini API Key as the sign-in method:
gemini
Client apps
In Cherry Studio, NextChat, LobeChat, Chatbox and similar apps, choose the OpenAI-compatible provider type and fill in:
| Field | Value |
|---|---|
| API URL | https://api.yuzuapi.com |
| API Key | sk-your-key |
| Model | e.g. claude-sonnet-4-5, gpt-5, gemini-2.5-pro |
Some apps require /v1 in the URL. If the connection fails, try https://api.yuzuapi.com/v1.
Code examples
Use the OpenAI SDK and change model to switch to any model.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.yuzuapi.com/v1",
apiKey: process.env.YUZU_API_KEY,
});
const res = await client.chat.completions.create({
model: "claude-sonnet-4-5",
messages: [{ role: "user", content: "Hello" }],
});
console.log(res.choices[0].message.content);import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.yuzuapi.com/v1",
api_key=os.environ["YUZU_API_KEY"],
)
res = client.chat.completions.create(
model="gpt-5",
messages=[{"role": "user", "content": "Hello"}],
)
print(res.choices[0].message.content)curl https://api.yuzuapi.com/v1/chat/completions \
-H "Authorization: Bearer $YUZU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gemini-2.5-pro", "messages": [{"role": "user", "content": "Hello"}]}'Troubleshooting
| Error | Fix |
|---|---|
command not found / not recognized as a command | Reopen your terminal. If it still fails, reinstall the tool |
EACCES | On macOS / Linux, prefix the command with sudo |
| Running scripts is disabled | Set-ExecutionPolicy -Scope CurrentUser RemoteSigned |
401 Unauthorized | Wrong or deleted API key. Check for extra spaces when pasting |
402 / insufficient balance | Top up in the console |
404 model not found | Wrong model name. Check Pricing |
Other issues? Contact us.