Venice keysVeniceLearn · GuidesOpen Venice ↗
Guide · Coding & Automation

Use Claude Code anonymously with Venice and the Claude Code Router

This guide shows how to route Claude Code through the Venice API using the Claude Code Router, so you pay per token instead of a monthly subscription and your requests are anonymized away from your Anthropic account.

Watch the full walkthrough
What you'll learn
  • Why paying per token through Venice can beat a recurring Claude subscription
  • How Venice anonymizes your Claude Code requests and how prompt caching cuts input costs
  • What the Claude Code Router does and how it redirects requests to Venice
  • The exact commands to install Claude Code, the router, and set up your config and API key
  • How to start the router, switch models, and run a real prompt

Why route Claude Code through Venice

With Venice you pay per token through the API instead of paying Anthropic a monthly subscription. Venice's API runs on its crypto token, DM (Diem), where one DM equals $1 in Venice credits per day. You buy once and keep that access, rather than paying every month.

The napkin math: a Claude subscription at $100 a month is $1,200 over a year. With that same $1,200 you could buy about three DM, which gives you roughly $3 per day of API credit that still works after a year is up, without renewing.

If $3 a day sounds small next to a $20 or $100 plan, it goes further than you'd expect, especially if you're not writing heavy code all day. Claude Code handles far more than programming: content, business tasks, and general work. Combined with prompt caching, that daily credit stretches well beyond what $3 sent straight to Anthropic's API would buy.

Privacy and prompt caching

Routing through Venice puts its privacy infrastructure in front of your Claude Code usage. For Claude Opus and Sonnet this means your requests are anonymized. They are not fully private, but they no longer travel under your name or your Anthropic account.

Prompt caching works alongside Claude Code and is where your costs drop. Providers like Anthropic offer up to 90% savings on input token costs when caching is used effectively. Picture a 2,000-token system prompt sent with every message: effective caching avoids re-sending those tokens each time. That lowers cost, improves output quality by sending fewer tokens, and reduces latency. Venice supports the Claude models with prompt caching, so the same $3 of credit covers far more real work.

How the Claude Code Router works

The Claude Code Router intercepts your message before Claude Code sends it to Anthropic. It converts the request format, maps it to Venice using Claude Opus 4.5 or Claude Sonnet 4.5, and redirects it to the Venice API. The result is that Venice processes your requests instead of Anthropic, which is the layer that keeps your usage off your Anthropic identity.

The router is open source and available on GitHub. The setup in this guide follows the official guide in the Venice docs at docs.venice.ai.

Prerequisites and installation

Before you start you need three things: a Venice account with API credits, Node.js installed on your device, and Claude Code. A quick Brave or Google search will show you how to install Node.js for your operating system.

Open a terminal (the standalone terminal app or the one built into VS Code both work). Install Claude Code, then install the Claude Code Router, using the commands from the Venice docs:

npm install -g @anthropic-ai/claude-code
npm install -g @musistudio/claude-code-router

If Claude Code is already installed, the command will just update a few packages and you're set.

Create the config file and add your API key

Make the configuration directory, then create the config file. In VS Code you can open the file directly; in a plain terminal, nano works fine. Paste in the configuration provided in the Venice docs.

Now generate your key. Go to your Venice API dashboard, click generate API key, give it a short description, and hit create. Copy the key, return to your config file, find the api_key field, and replace whatever placeholder is there with your key.

Press save. This matters: any time you edit the config file later, you have to restart the router for the changes to take effect.

Start the router and pick a model

Start the router service, then launch Claude Code in a second terminal:

ccr start
ccr code

When ccr start runs, it loads the config file you just made. Leave that terminal open, start a new terminal window, and run ccr code. Approve trusting the files in your folder and Claude Code is running.

Use /model to switch between Opus, Sonnet, and Haiku, with pricing shown for each. Opus is the most powerful but the most expensive, so start with Sonnet, or Haiku for simpler tasks. Check the Venice docs for current Venice API pricing, since you're billed through Venice, not Anthropic, and the prices differ. If something like ccr start misbehaves, run ccr restart. You'll also use ccr restart every time you edit the config.

Run a prompt and see the result

To confirm everything is wired up, ask the model what's running it. It should answer that it's a Claude model powered by Anthropic, running on Venice AI.

For a real test, the demo feeds Claude Code a prompt to build an on-brand landing page, supplying a reference image, colors, value propositions, and a note about the token ecosystem. Claude Code creates the index.html, builds the stylesheet, and adds a JavaScript effect, asking permission before writing files. You don't need to understand every step; you can ask it what the best approach is and it will explain as it works.

Opening the resulting index.html shows a page that follows the supplied colors. It needs polish, but it's a solid result from one prompt in about five minutes, and the same workflow applies far beyond websites. If you hit problems, the Venice Discord community can help.

Key takeaways

From the Commons

Related discussions

Ask the community about this →

Adapted from the @askvenice video on YouTube. Models and prices change fast; verify current details in Venice before production use.