Use with Claude Code
How to use Nexus API with Claude Code - Claude API integration tutorial. Configure ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN to connect Claude Code to Nexus API gateway.
Install Claude Code
Using pnpm:
pnpm install -g @anthropic-ai/claude-codeUsing npm:
npm install -g @anthropic-ai/claude-codeUsing yarn:
yarn global add @anthropic-ai/claude-codeConfigure Environment Variables
Set environment variables in your terminal to use Nexus API:
Linux / macOS
# Set API base URL
export ANTHROPIC_BASE_URL=https://nexusapi.one/
# Set your API key (get it from https://nexusapi.one/console/token)
export ANTHROPIC_AUTH_TOKEN=sk-xxx
# Optional: set model
export ANTHROPIC_MODEL=claude-sonnet-4-5-20250929-thinkingWindows PowerShell
# Set API base URL
$env:ANTHROPIC_BASE_URL="https://nexusapi.one/"
# Set your API key (get it from https://nexusapi.one/console/token)
$env:ANTHROPIC_AUTH_TOKEN="sk-xxx"
# Optional: set model
$env:ANTHROPIC_MODEL="claude-sonnet-4-5-20250929-thinking"Important: Replace
sk-xxxwith your actual API key. You can get it from the Console.
Start Using
After configuring environment variables, navigate to your project directory and run:
# Enter your project directory
cd my-project
# Start Claude Code
claudePersistent Configuration
Add the environment variables to your shell config file to avoid setting them every time:
Linux / macOS
Add to ~/.bashrc or ~/.zshrc:
export ANTHROPIC_BASE_URL=https://nexusapi.one
export ANTHROPIC_AUTH_TOKEN=sk-xxx
export ANTHROPIC_MODEL=claude-sonnet-4-5-20250929-thinkingWindows PowerShell
Add to your PowerShell profile ($PROFILE):
$env:ANTHROPIC_BASE_URL="https://nexusapi.one/"
$env:ANTHROPIC_AUTH_TOKEN="sk-xxx"
$env:ANTHROPIC_MODEL="claude-sonnet-4-5-20250929-thinking"VS Code Extension Configuration
If you use the Claude Code VS Code extension, add the following to your settings.json (press Ctrl+Shift+P / Cmd+Shift+P → "Preferences: Open User Settings (JSON)"):
{
// ========== Claude Code Extension ==========
"claudeCode.selectedModel": "claude-sonnet-4-5-20250929",
"claudeCode.environmentVariables": [
{
"name": "ANTHROPIC_AUTH_TOKEN",
"value": "sk-xxx" // Replace with your API key from https://nexusapi.one/console/token
},
{
"name": "ANTHROPIC_BASE_URL",
"value": "https://nexusapi.one"
},
{
"name": "API_TIMEOUT_MS",
"value": "300000"
}
],
"claudeCode.preferredLocation": "sidebar"
}Tips:
- Replace
sk-xxxwith your actual API key from the Console- You can change
selectedModelto any supported Claude model, e.g.claude-opus-4-5-20250929API_TIMEOUT_MSsets the request timeout (default 300 seconds), increase it for long-running tasks- This also works with Cursor, Windsurf, and other VS Code-based editors
Quick Start - AI API Integration Guide
Nexus API provides unified AI API proxy services for Claude API, OpenAI API, Grok API, Gemini API and more. Supports GPT-5, Claude Sonnet, DeepSeek, GLM-4.5 and other large language models through a single API endpoint.
Use with OpenAI Codex
How to use Nexus API with OpenAI Codex - OpenAI API integration tutorial. Configure config.toml to connect Codex to Nexus API gateway for GPT-5 and other models.