NexRelayNexRelay
NexRelay

Setup docs

Connect your client

Create API key

Use one NexRelay API link with Codex, Cursor, Claude Code, Cline, Chatbox, OpenAI SDKs, and Gemini-compatible tools.

1

Add credits

2

Create key

3

Copy setup

4

Restart client

Codex

Codex

Copy setup command

Claude Code

Claude Code CLI

Terminal CLI only

OpenAI SDKs

Use base URL + key

Gemini tools

Use gateway settings

Your API links

Copy the route your client asks for.

Most clients use this base URL

https://nexrelay-api.xyz/api/v1

OpenAI-compatible

https://nexrelay-api.xyz/api/v1

Claude-style

https://nexrelay-api.xyz/v1/messages

Gemini-style

https://nexrelay-api.xyz/v1beta

Supported models

All latest supported model IDs

Claude Code by OS

Windows, macOS, and Linux setup

Replace sk_live_xxx with your API key.
These commands are for Claude Code CLI. They do not configure the Claude for Windows desktop app, which always uses Anthropic account login and does not read custom API base URL settings.

Windows CMD

Paste into CMD, replace sk_live_xxx, then open a new terminal before running claude.

setx ANTHROPIC_BASE_URL "https://nexrelay-api.xyz" >nul & setx ANTHROPIC_AUTH_TOKEN "sk_live_xxx" >nul & setx ANTHROPIC_API_KEY "sk_live_xxx" >nul & echo Open a NEW CMD or PowerShell window, then run: claude

macOS Terminal

Paste into Terminal, replace sk_live_xxx with your NexRelay key, then run claude.

mkdir -p "$HOME/.claude"
[ -f "$HOME/.claude/settings.json" ] && cp "$HOME/.claude/settings.json" "$HOME/.claude/settings.json.bak"
cat > "$HOME/.claude/settings.json" <<'EOF'
{
  "env": {
    "ANTHROPIC_API_KEY": "sk_live_xxx",
    "ANTHROPIC_AUTH_TOKEN": "sk_live_xxx",
    "ANTHROPIC_BASE_URL": "https://nexrelay-api.xyz"
  },
  "includeCoAuthoredBy": false
}
EOF
echo "Open a new terminal, then run: claude"

Linux Terminal

Paste into your shell, replace sk_live_xxx with your NexRelay key, then run claude.

mkdir -p "$HOME/.claude"
[ -f "$HOME/.claude/settings.json" ] && cp "$HOME/.claude/settings.json" "$HOME/.claude/settings.json.bak"
cat > "$HOME/.claude/settings.json" <<'EOF'
{
  "env": {
    "ANTHROPIC_API_KEY": "sk_live_xxx",
    "ANTHROPIC_AUTH_TOKEN": "sk_live_xxx",
    "ANTHROPIC_BASE_URL": "https://nexrelay-api.xyz"
  },
  "includeCoAuthoredBy": false
}
EOF
echo "Open a new terminal, then run: claude"

If you see a Claude for Windows welcome screen or Google/email sign-in, close it. Open CMD or PowerShell and run claude from the terminal instead.

What success looks like

Your client sends requests through NexRelay and Usage shows key, model, token meters, status, and billed amount.

Common mistake

Windows CMD cannot run raw JSON. Paste the full setup command copied from the API key page, then open a new terminal and run claude. Do not open the Claude for Windows desktop app for this setup.

Troubleshooting

401

Missing or incomplete API key.

402

Wallet or key budget is exhausted.

Login

The Claude for Windows desktop app always asks for Anthropic login. Use Claude Code CLI from CMD, PowerShell, Terminal, or Linux shell.