Migrate to Viro
Viro speaks the OpenAI API, so moving an app from another OpenAI-compatible provider is three changes: the base URL, the API key and the model name. Your streaming, tool calling and structured outputs keep working.
To move the agent itself (Claude Code, Codex CLI, OpenCode, Hermes Agent, Cline, Aider, Continue, OpenClaw or Cursor) onto Viro, follow its page under Integrations, or paste the Run my coding agent on Viro prompt from the Quickstart into it. The rest of this page is for code you've written yourself.
Create a key on API Keys, store it as VIRO_API_KEY, and change the client:
# Python
from openai import OpenAI
import os
client = OpenAI(
base_url="https://api.viro.app/v1",
api_key=os.environ["VIRO_API_KEY"],
)// TypeScript
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.viro.app/v1",
apiKey: process.env.VIRO_API_KEY,
});If your code reads OPENAI_BASE_URL and OPENAI_API_KEY, setting those two variables is enough: OPENAI_BASE_URL=https://api.viro.app/v1.
Viro model IDs say where a model runs: viro/* for open-weight models Viro serves on clean energy, <lab>/* for frontier models routed to their lab with energy matched. Common equivalents:
| From | Model you use now | On Viro |
|---|---|---|
| OpenAI | gpt-5.6-terra | openai/gpt-5.6-terra |
| Anthropic | claude-sonnet-5 | anthropic/claude-sonnet-5 |
| gemini-3.6-flash | google/gemini-3.6-flash | |
| xAI | grok-4.5 | xai/grok-4.5 |
| DeepSeek, on any host | deepseek-v4-pro | viro/deepseek-v4-pro |
| Kimi, on any host | kimi-k2.5 | viro/kimi-k2.5 |
| GLM, on any host | glm-5.3 | viro/glm-5.3 |
| GPT-OSS, on any host | gpt-oss-120b | viro/gpt-oss-120b |
| Not sure, or let Viro choose | — | viro/clean |
The full list, with prices, is on Models or at GET https://api.viro.app/v1/models. A router (viro/clean, viro/optimized, viro/frontier) picks the model for each request; see Model Routing.
- Rate limit: 60 requests a minute per key by default. Every response carries your current standing; see Errors for the headers and the 429 to handle.
- Using Anthropic's SDK? Viro also serves the Messages API: set the SDK's base URL to
https://api.viro.appand use your Viro key. Through the OpenAI SDK,response_formatis ignored onanthropic/*. - GPT-5.6 with tools: OpenAI doesn't accept a reasoning setting alongside tools on this API, so on GPT-5.6 tool calls it is turned off.
- Extra fields, safe to ignore: every response has a
viroobject saying where it ran and on what energy, and routed requests return the model that actually ran inx-viro-resolved-model. - Built-in tools: add
{"type": "viro:web_search"}and Viro runs the search for you, mid-completion. If you already have your ownweb_searchfunction, keep it, or switch to Viro's, but don't send both in one request. See Server tools. - Prompt caching is automatic where the model supports it; there's nothing to turn on. See Prompt caching.
curl https://api.viro.app/v1/chat/completions \
-H "Authorization: Bearer $VIRO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "viro/clean", "messages": [{"role": "user", "content": "Say hi"}]}'Then run your own test suite against Viro before switching production traffic. Each request shows up on Usage with its cost and energy.