Skip to main content

Claude Code

Claude Code is Anthropic’s official CLI tool for interacting with Claude directly from your terminal. By routing Claude Code through Shinzo, you gain visibility into your AI usage patterns, token consumption, response times, and costs.

How It Works

Shinzo acts as a transparent proxy between Claude Code and the Anthropic API. When you configure Claude Code to use Shinzo:
  1. Your requests are sent to Shinzo instead of directly to Anthropic
  2. Shinzo authenticates your request using your Shinzo API key
  3. The request is forwarded to Anthropic with your Anthropic credentials
  4. Analytics are recorded (tokens, latency, errors, etc.)
  5. The response is returned to Claude Code

Understanding API Keys

Shinzo uses two types of API keys that serve different purposes:

Shinzo API Key (Platform Key)

The Shinzo API Key authenticates you with the Shinzo platform. This key:
  • Identifies your account and project
  • Enables analytics tracking for your requests
  • Format: sk_shinzo_live_xxxxx or sk_shinzo_test_xxxxx
You create and manage Shinzo API keys in the Shinzo Platform under Settings > API Keys.

Provider API Key (Anthropic Key)

The Provider API Key is your actual Anthropic API key that authenticates requests with Claude. This key:
  • Grants access to Claude models
  • Is billed by Anthropic for token usage
  • Format: sk-ant-api03-xxxxx (standard API key) or sk-ant-oat01-xxxxx (OAuth token)

Configuration Modes

Shinzo supports two methods for configuring Claude Code. Both methods require updating the API endpoint to Shinzo’s proxy URL.

Comparison of Modes

FeatureShinzo as API KeyShinzo as Custom Header
Anthropic key locationStored encrypted in ShinzoKept in local environment
Anthropic key transmissionNever leaves Shinzo serversPassed through on every request
Store provider key in Shinzo?Yes (required)No
Environment variables needed2 (API_KEY, BASE_URL)3 (API_KEY, BASE_URL, CUSTOM_HEADERS)
Key rotationUpdate in Shinzo dashboardUpdate local environment
Recommended forMost usersUsers who cannot store keys externally

What Gets Tracked

When Claude Code routes through Shinzo, the following data is collected:
DataCollectedNotes
Request timestampYesWhen the request was made
Response latencyYesTime to first token, total time
Input tokensYesTokens in your prompt
Output tokensYesTokens in Claude’s response
Model usedYese.g., claude-sonnet-4-20250514
Success/failureYesHTTP status codes, error types
Request contentNoYour prompts are not stored
Response contentNoClaude’s responses are not stored
Shinzo follows a privacy-first approach. Message content is never stored or logged. Only metadata required for analytics is collected.

Managing API Keys

Rotating Keys

If using “Shinzo as API Key” mode:
  1. Generate a new key in the Anthropic Console
  2. Update the key in Shinzo under Settings > API Keys > Provider Keys
  3. Revoke the old key in Anthropic
  4. No changes to your Claude Code configuration required
If using “Shinzo as Custom Header” mode:
  1. Generate a new key in the Anthropic Console
  2. Update your local ANTHROPIC_API_KEY environment variable
  3. Revoke the old key in Anthropic

Multiple Shinzo Keys

You can create multiple Shinzo API keys for different purposes:
  • Per-machine keys: Create separate keys for work and personal computers
  • Per-project keys: Track usage by project or team
  • Test vs. production: Use test type keys for development

Revoking Keys

To revoke a compromised Shinzo key:
  1. Go to Settings > API Keys in Shinzo
  2. Find the key and click Revoke
  3. Create a new key and update your configuration

Troubleshooting

  1. Verify your environment variables are set correctly:
    echo $ANTHROPIC_BASE_URL
    echo $ANTHROPIC_API_KEY
    echo $ANTHROPIC_CUSTOM_HEADERS  # if using custom header mode
    
  2. Ensure ANTHROPIC_BASE_URL is set to https://api.app.shinzo.ai/spotlight/anthropic
  3. Ensure the Shinzo API key is valid and not revoked
  4. If using “Shinzo as API Key” mode, check that you have a provider key configured in Shinzo
  5. Try a new terminal session to reload environment variables
  • 401 Unauthorized: Your Shinzo API key is invalid or revoked
  • 403 Forbidden: Your Anthropic key may be invalid or expired
  • If using “Shinzo as API Key” mode, verify your provider key is configured in Shinzo
  • If using “Custom Header” mode, verify your ANTHROPIC_API_KEY is correct
  1. Verify you can reach api.app.shinzo.ai:
    curl -I https://api.app.shinzo.ai/health
    
  2. Check your network/firewall settings
  3. If using a corporate proxy, ensure it allows HTTPS connections to Shinzo
To bypass Shinzo temporarily:
unset ANTHROPIC_BASE_URL
unset ANTHROPIC_CUSTOM_HEADERS
export ANTHROPIC_API_KEY="sk-ant-api03-your-anthropic-key"

Next Steps