⚑ Setup Guide

Configure your AI tools to use 15code API

πŸ€– OpenAI Protocol (Codex, GPT, Cursor, etc.)
https://cli.15code.com/v1
🧠 Anthropic Protocol (Claude Code)
https://claude.15code.com
⚑ Codex
πŸ€– Claude Code
🎯 Cursor
πŸ“ OpenCode

⚑ Codex Setup Guide

OpenAI's official coding agent, supports GPT-5.3-Codex model

1
Install Node.js (skip if already installed)
MacOS / Linux
brew install node # or sudo apt install nodejs npm -y node --version
Windows
winget install OpenJS.NodeJS.LTS # or download from https://nodejs.org/
2
Install Codex
npm install -g @openai/codex codex --version
πŸ’‘ China users: npm install -g @openai/codex --registry=https://registry.npmmirror.com
3
Configure API (Key Step)

Get your API Key from 15code.com Dashboard

MacOS / Linux
export OPENAI_API_KEY=sk-your-api-key-here export OPENAI_BASE_URL=https://cli.15code.com/v1 echo 'export OPENAI_API_KEY=sk-your-api-key' >> ~/.bashrc echo 'export OPENAI_BASE_URL=https://cli.15code.com/v1' >> ~/.bashrc source ~/.bashrc
Windows PowerShell
$env:OPENAI_API_KEY="sk-your-api-key-here" $env:OPENAI_BASE_URL="https://cli.15code.com/v1" [Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "sk-your-key", "User") [Environment]::SetEnvironmentVariable("OPENAI_BASE_URL", "https://cli.15code.com/v1", "User")
4
Test Connection
codex codex "Create a hello.py file"
βœ… If Codex starts working, configuration is successful!
⚠️ Keep your API Key private - never upload to GitHub or share with others

πŸ€– Claude Code Setup Guide

Anthropic's official CLI tool, supports Claude Sonnet 4.6

1
Install Node.js 18+ (and Git Bash on Windows)
macOS
brew install node
Linux
sudo apt install nodejs npm -y
Windows β€” install both Node.js + Git for Windows

Claude Code needs a bash shell at runtime (it invokes bash for file edits, command execution). On Windows that's provided by Git Bash. npm install works in PowerShell/CMD, but running claude requires Git Bash.

Option A Β· Direct download (most reliable)

  1. Node.js LTS β†’ nodejs.org/en/download
  2. Git for Windows (includes Git Bash) β†’ git-scm.com/download/win
  3. Accept defaults for both installers

Option B Β· winget

winget install OpenJS.NodeJS.LTS winget install Git.Git

After install: Start menu β†’ search Git Bash. Run all following commands in Git Bash.

Verify in Git Bash:

node --version npm --version git --version bash --version
⚠️ Common pitfall: running claude from PowerShell/CMD fails with "bash: command not found" or tool execution errors. Use Git Bash.
2
Install Claude Code
npm install -g @anthropic-ai/claude-code claude --version
πŸ‡¨πŸ‡³ China users (mirror)
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com
3
Configure environment variables
πŸ’‘ Setting ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN tells Claude Code to use 15code directly β€” no OAuth login required, no --bare or similar flags.

Get your API key from 15code Dashboard.

macOS / Linux / Windows Git Bash

Replace sk-u-your-key with your real key, paste the whole block:

cat >> ~/.bashrc << 'EOF' export ANTHROPIC_BASE_URL="https://claude.15code.com" export ANTHROPIC_AUTH_TOKEN="sk-u-your-key" export ANTHROPIC_API_KEY="sk-u-your-key" EOF source ~/.bashrc claude

macOS: default shell is zsh β€” replace ~/.bashrc with ~/.zshrc (check with echo $SHELL)
Windows Git Bash: reads ~/.bashrc, use as-is
Linux: ~/.bashrc

⚠️ Windows users: make sure your terminal title is "MINGW64" or prompt is $ (not >). If not, close and open Git Bash instead.
⚠️ Why two token variables? Different Claude Code versions read different env names. Setting both ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY covers all cases.
4
Start Claude Code
# Interactive mode (most common) claude # Pick a specific model claude --model claude-opus-4-7 # top-tier flagship claude --model claude-sonnet-4-6 # balanced # One-shot / scriptable claude -p "review this code" < main.py # Help claude --help
βœ… If you see the > prompt and Claude responds β€” you're set.
5
⚠️ Troubleshooting
❌ "Not logged in" / OAuth errors

Check env vars (each line should print a value):

echo "$ANTHROPIC_BASE_URL $ANTHROPIC_AUTH_TOKEN $ANTHROPIC_API_KEY"

If you've run claude /login before, clear cached OAuth:

rm -rf ~/.claude/auth.json ~/.claude/credentials

Windows CMD: del "%USERPROFILE%\.claude\auth.json"

❌ 401 Unauthorized

New keys take 1-2s to propagate. If it persists after 10s, verify the key at Dashboard β€” not disabled, fully copied (starts with sk-u).

❌ Connection timeout

Test reachability:

curl -H "Authorization: Bearer $ANTHROPIC_AUTH_TOKEN" https://claude.15code.com/v1/models

🎯 Cursor Setup Guide

Popular AI-powered IDE, supports GPT-5.4 and Claude models

1
Download Cursor

Visit cursor.sh to download

2
Configure API

Open Cursor Settings (Cmd+,) β†’ Models β†’ OpenAI

API Key: sk-your-api-key-here Base URL: https://cli.15code.com/v1
3
Select Model
Recommended: gpt-5.3-codex (coding) General: gpt-5.4
βœ… Start using Cursor with 15code API!

πŸ“ OpenCode Setup Guide

Open-source AI coding assistant, supports multiple models

1
Install OpenCode
npm install -g opencode opencode --version
2
Configure API
MacOS / Linux
export OPENCODE_API_KEY=sk-your-api-key export OPENCODE_BASE_URL=https://cli.15code.com/v1
Windows
$env:OPENCODE_API_KEY="sk-your-api-key" $env:OPENCODE_BASE_URL="https://cli.15code.com/v1"
3
Test
opencode opencode "Create a simple HTTP server"
βœ… Configuration successful!