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:- Your requests are sent to Shinzo instead of directly to Anthropic
- Shinzo authenticates your request using your Shinzo API key
- The request is forwarded to Anthropic with your Anthropic credentials
- Analytics are recorded (tokens, latency, errors, etc.)
- 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_xxxxxorsk_shinzo_test_xxxxx
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) orsk-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.- Shinzo as API Key (Recommended)
- Shinzo as Custom Header
Mode 1: Shinzo as the API Key
This is the recommended approach. Your Anthropic API key is stored securely in Shinzo, and you use your Shinzo API key in place of your Anthropic key.How it works:- Store your Anthropic API key securely in Shinzo (encrypted at rest)
- Set your Shinzo API key as the
ANTHROPIC_API_KEYenvironment variable - Update
ANTHROPIC_BASE_URLto point to Shinzo’s endpoint - Shinzo retrieves your stored Anthropic key server-side for each request
- Your Anthropic key is stored securely and never transmitted from your machine
- Easy key rotation - update in Shinzo without reconfiguring Claude Code
- Works with any tool that supports
ANTHROPIC_API_KEY - Compatible with all Anthropic SDKs
Add your Anthropic API key to Shinzo
- Go to app.shinzo.ai
- Navigate to Settings > API Keys
- Click the Provider Keys tab
- Click Add Provider Key
- Select Anthropic as the provider
- Paste your Anthropic API key and add a label
- Click Save
Your key will be validated and encrypted before storage.
Create a Shinzo API key
- In the API Keys page, click the Shinzo Keys tab
- Click Create Key
- Give your key a descriptive name (e.g., “Claude Code - Work Laptop”)
- Copy the generated key (you won’t see it again)
Configure Claude Code
Set the following environment variables based on your operating system:
- macOS / Linux
- Windows (PowerShell)
- Windows (Command Prompt)
Add to your shell configuration file (Then reload your shell:
~/.bashrc, ~/.zshrc, etc.):Verify the configuration
Run Claude Code and make a test request:Then check the Shinzo Dashboard to see your request logged.
If your request appears in the dashboard, you’re all set.
Comparison of Modes
| Feature | Shinzo as API Key | Shinzo as Custom Header |
|---|---|---|
| Anthropic key location | Stored encrypted in Shinzo | Kept in local environment |
| Anthropic key transmission | Never leaves Shinzo servers | Passed through on every request |
| Store provider key in Shinzo? | Yes (required) | No |
| Environment variables needed | 2 (API_KEY, BASE_URL) | 3 (API_KEY, BASE_URL, CUSTOM_HEADERS) |
| Key rotation | Update in Shinzo dashboard | Update local environment |
| Recommended for | Most users | Users who cannot store keys externally |
What Gets Tracked
When Claude Code routes through Shinzo, the following data is collected:| Data | Collected | Notes |
|---|---|---|
| Request timestamp | Yes | When the request was made |
| Response latency | Yes | Time to first token, total time |
| Input tokens | Yes | Tokens in your prompt |
| Output tokens | Yes | Tokens in Claude’s response |
| Model used | Yes | e.g., claude-sonnet-4-20250514 |
| Success/failure | Yes | HTTP status codes, error types |
| Request content | No | Your prompts are not stored |
| Response content | No | Claude’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:- Generate a new key in the Anthropic Console
- Update the key in Shinzo under Settings > API Keys > Provider Keys
- Revoke the old key in Anthropic
- No changes to your Claude Code configuration required
- Generate a new key in the Anthropic Console
- Update your local
ANTHROPIC_API_KEYenvironment variable - 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
testtype keys for development
Revoking Keys
To revoke a compromised Shinzo key:- Go to Settings > API Keys in Shinzo
- Find the key and click Revoke
- Create a new key and update your configuration
Troubleshooting
Requests not appearing in dashboard
Requests not appearing in dashboard
- Verify your environment variables are set correctly:
- Ensure
ANTHROPIC_BASE_URLis set tohttps://api.app.shinzo.ai/spotlight/anthropic - Ensure the Shinzo API key is valid and not revoked
- If using “Shinzo as API Key” mode, check that you have a provider key configured in Shinzo
- Try a new terminal session to reload environment variables
Authentication errors
Authentication errors
- 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_KEYis correct
Connection timeouts
Connection timeouts
- Verify you can reach
api.app.shinzo.ai: - Check your network/firewall settings
- If using a corporate proxy, ensure it allows HTTPS connections to Shinzo
Switching back to direct Anthropic access
Switching back to direct Anthropic access
To bypass Shinzo temporarily:

