Venice keysVeniceLearn · GuidesOpen Venice ↗
Guide · AI Agents

Set up model routing in OpenClaw with the Venice API

Learn how to install a model routing skill in your OpenClaw agent so simple tasks go to cheap models and hard tasks go to premium ones, cutting API costs without losing performance. The guide walks through setup, secure key configuration, tier customization, and testing against the Venice API.

Watch the full walkthrough
What you'll learn
  • Why sending every prompt to a premium model wastes API credits
  • How a three-tier task classification system routes prompts by complexity
  • How to install the Venice router skill and configure your API key securely
  • How to customize model tiers and invoke routing in a session
  • How to confirm which model a prompt actually routed through

Why routing saves money

Every prompt you send to an AI agent like OpenClaw costs API credits, but not every prompt needs a premium model. Checking a status, formatting a file, or running a git push can be handled by a cheaper model just as well as an expensive one. Defaulting everything to a premium model burns credits on work that does not require it.

Model routing fixes this. A router inspects the type of task and sends it to a model tier that matches the difficulty. You cut costs on routine work, keep premium power available for hard problems, and your agent gets smarter about how it spends.

Get a Venice API key and free daily credits

To follow along you need an API key from Venice at venice.ai, plus credits to spend. If you have never used Venice, the DIEM token is the easiest way to start: holding one gives you $1 in API credits per day, and the allowance refreshes daily on its own.

Once you have credits or DIEM in place, generating an API key from the dashboard is quick. Have that key ready before you start the install, because the routing skill needs it to function.

The three-tier system and why Venice

Model routers sort prompts into tiers by complexity. Routine tasks (status checks, formatting, git operations) go to a cheap model. Moderate tasks (writing code, summarizing, drafting) go to a mid-tier model. Complex tasks (debugging, architecture, strategy, novel problems) go to a premium model.

This guide runs routing through the Venice API, which exposes 128 models across text, image, video, audio, and embeddings, including fully private and anonymized options. The walkthrough focuses on text model routing, which gives you a wide range of price and capability tiers to map your tasks against.

Install the skill and configure the key securely

Download the router skill zip file, open your OpenClaw agent, attach the zip, and tell it to install. The agent reads the files and installs the Venice router skill. It still needs your API key to work.

Do not paste API keys as plain text into unencrypted chats like Telegram. Instead, edit your configuration file directly. Run OpenClaw in a Docker container rather than your main machine, then open the hidden config file:

nano ~/.openclaw/openclaw.json

Ask OpenClaw exactly what to add for the skill. It returns a JSON block you paste in (skip the outer brackets, which already exist, and add a comma so the formatting stays valid). Make sure the Venice router skill is enabled, paste your API key in the field provided, then save and exit (Control X, then Y, then Enter). Finally, restart the gateway so the changes take effect:

openclaw gateway restart

Confirm it worked by asking the agent whether the Venice routing skill is operational.

Customize your model tiers

Ask the agent to show your model tiers. Because Venice offers so many models, you will see more tiers than a basic example repo provides. You can keep the defaults or tune each tier to your preferences and budget.

In the walkthrough, the tiers were set roughly like this: premium uses Claude Opus 4.6 with GPT fallback, high uses Claude Sonnet 4.6, mid and budget-medium were merged onto Qwen3 235B, and cheap uses a small Qwen model (Venice Small). Checking a model's price first helps you decide where it belongs. For example, if Qwen3 235B costs $3.50 output, set the mid tier budget to match. Send your customization to the agent and it rewrites the configuration accordingly.

How the routing logic works

The skill runs a small Python script that classifies the task and picks a tier. Reviewing the installed skill shows a clean security scan, a description that matches its actual behavior, and the exact JSON the agent told you to add.

You can go further with environment variables added to openclaw.json: set a budget, toggle thinking on or off, or force private-only mode so the router never pulls non-private frontier models. The powerful frontier models are not private, so this flag matters if anonymity is your priority. You can also set max tokens and temperature for finer control.

Test the router and confirm the model used

Routing does not happen automatically. You have to invoke the skill in your prompt. Making it fully automatic is possible but considerably more work.

Start a new session and prompt the router explicitly, for example "route this through Venice" with a simple request like "explain recursion." Then ask which Venice model handled it. A basic task routes to the cheap tier (Venice Small). Now try a complex task such as "write a distributed systems architecture PRD." That request takes longer and routes to a premium model like Claude Opus 4.6, confirming the tiers behave as configured.

Next steps and community

This setup covers text routing only. There is more to explore, including image and video routing and getting the router to trigger automatically without an explicit prompt.

The skill comes from a community contributor (Badmuff) on Clawhub, with a link in the video description. If you make progress on automatic routing or extend it to other media types, share it on the Venice Discord, where people are building agents and trading guidance.

Key takeaways

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