Skip to main content
Claude Code is Anthropic’s CLI tool for agentic coding. This guide shows you how to run it through Venice for anonymized, pay-per-token access to Claude models.

Pay Per Token

No subscription. Pay only for what you use

Claude Models

Access current Opus, Sonnet, and Fable models through Venice

Prompt Caching

Venice caching works alongside Claude Code

Why You Need a Router

Claude Code connects directly to Anthropic’s API by default. To use it with Venice, you need claude-code-router, an open-source local proxy that:

Intercepts

Catches Claude Code’s outgoing requests before they reach Anthropic

Transforms

Converts Anthropic Messages requests into Venice’s OpenAI-compatible chat format

Redirects

Forwards requests to api.venice.ai/api/v1/chat/completions

Prerequisites

Venice Account

With Venice credits

Node.js

v22 or higher

Claude Code

Installed via npm

Setup

1

Install or update Claude Code

Install the latest Claude Code CLI:
2

Install Claude Code Router

3

Get Your API Key

Generate a key from venice.ai/settings/api. You will add it to CCR in the next step.
4

Add Venice as a provider

Start CCR’s management UI:
On the Providers page, choose Add provider and then Other / custom API endpoint. Enter:
  • Name: Venice
  • API endpoint: https://api.venice.ai/api/v1
  • API key: your Venice API key
CCR should detect OpenAI Chat automatically. If it does not, open Advanced settings, turn off automatic protocol detection, and select OpenAI Chat.Use Search models or Custom models to add the Claude models you want, then run Check Connection and save the provider. The connection check sends a real request with a one-token output limit.
5

Create a Claude Code profile

In Agent Config, choose Add profile and then Claude Code:
  • Name the profile Claude Code - Venice.
  • Keep Effect scope set to Only opened from CCR while testing.
  • Choose CLI only or CLI & APP.
  • Set Model to a Venice model such as Venice/claude-opus-4-8.
  • To keep every Claude Code tier on Venice, set the optional Fable, Opus, Sonnet, and Haiku model fields to Venice models too.
Save the profile.
6

Launch and verify

Launch the profile by name:
In Claude Code:
  1. Run /context and confirm the context window matches the selected model. For claude-opus-4-8, it should show 1M.
  2. Run /model if you want to switch to another Venice model; 1M variants are marked 1M context.
  3. Send a test message, then check Request logs in CCR to confirm that it used Venice.

Supported Models

The catalog changes over time. Use Search models in CCR or GET /models?type=text for the current list and limits.
Claude Code is optimized for Claude models. While other models available through Venice (GPT, DeepSeek, Grok, etc.) may work, we cannot guarantee an equivalent experience since Claude Code relies on Claude-specific features like extended thinking. For other models, consider using Venice’s standard API.

Updating an Existing Installation

Update CCR before troubleshooting an existing installation:
Current CCR releases store live configuration in ~/.claude-code-router/config.sqlite. An older config.json is imported when the database does not exist. After migration, make changes through ccr ui instead of continuing to edit config.json. If a background process is still running after an update, restart it:

Prompt Caching

Venice prompt caching works with Claude Code’s native cache markers. No additional cache transformer is required for the normal setup.

Troubleshooting

  1. Update CCR with npm install -g @musistudio/claude-code-router@latest.
  2. Launch a new Claude Code session from the CCR profile.
  3. Run /model and select the Venice entry marked 1M context.
  4. Run /context and confirm that the window is 1M, not 200K.
Older CCR releases may not expose the correct context window or token usage to Claude Code.
Confirm Node.js 22 or newer and update CCR:
Use ccr serve to run in the foreground and expose the original startup error. A Cannot read properties of undefined (reading 'error') stack from server.logger.error indicates an outdated CCR installation; update it before investigating further.
Start the gateway and verify its health:
A failed health check means the local CCR gateway is unavailable; the request has not reached Venice.
Open ccr ui and make the change there. Current CCR releases store configuration in config.sqlite; config.json is only a migration source for older installations.

Resources

Venice API Docs

Full API reference

claude-code-router

Source code and issues

CCR Releases

Current versions and release notes