Using BlazeAPI with Claude Code
Connect Claude Code to BlazeAPI so all your AI coding requests route through your BlazeAPI key.
Prerequisites
- A BlazeAPI account and API key — get one from the Dashboard
- Node.js 18+ installed
- Claude Code CLI installed (see official docs)
Step 1 — Install Claude Code
If you haven't already, install the Claude Code CLI globally:
# Install Claude Code via npm
npm install -g @anthropic-ai/claude-code
# Or if you prefer npx (no install needed)
npx @anthropic-ai/claude-codeStep 2 — Configure BlazeAPI as the endpoint
You have two options: edit the Claude Code settings file or set environment variables.
Option A: Edit settings.json (Recommended)
Open the settings file at ~/.claude/settings.json:
# Open (or create) the Claude Code settings file
mkdir -p ~/.claude
nano ~/.claude/settings.jsonPaste the following configuration (replace your-blazeapi-key with your actual API key):
{
"env": {
"ANTHROPIC_BASE_URL": "https://ai.boxu.dev/anthropic",
"ANTHROPIC_API_KEY": "your-blazeapi-key"
}
}Option B: Use environment variables
Set these environment variables so Claude Code picks them up automatically:
# Add to your shell profile (~/.zshrc or ~/.bashrc)
export ANTHROPIC_BASE_URL="https://ai.boxu.dev/anthropic"
export ANTHROPIC_API_KEY="your-blazeapi-key"Then reload your shell:
# Reload your shell profile
source ~/.zshrc # or source ~/.bashrcStep 3 — Verify the connection
Launch Claude Code and confirm it's routing through BlazeAPI:
# Launch Claude Code
claude
# Once inside, verify the connection by asking:
# "What model are you?"If Claude Code responds normally, you're all set! All requests are now routed through BlazeAPI and will count against your BlazeAPI credit balance.
Troubleshooting
Connection refused or timeout
Make sure the base URL is exactly https://ai.boxu.dev/anthropic with no trailing slash.
Authentication error (401/403)
Double-check that your BlazeAPI key is correct. You can regenerate it from the Dashboard.
Settings not taking effect
Run source on your shell profile or restart your terminal after making changes.
Model not found errors
Claude Code defaults to Anthropic models. Check the Models page to see which models are currently available through BlazeAPI.
Important Notes
- Each Claude Code request uses credits from your BlazeAPI balance.
- The
ANTHROPIC_API_KEYvalue should be your BlazeAPI key, not an Anthropic key. - If you also use Claude Code with a direct Anthropic subscription, remove or comment out the environment variables when switching back.