← Back to Virouter

OpenAI + Anthropic API Gateway

OpenAI + Anthropic API Gateway with One Key

Virouter gives developers one OpenAI-compatible endpoint for GPT and Claude workloads. Keep one API key, one Billing USD Quota wallet, and one usage log while routing requests to OpenAI and Anthropic models.

No card for trial · Telegram verification · Transparent per-request cost

Drop-in endpointonline
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.virouter.com/v1",
  apiKey: process.env.VIROUTER_API_KEY,
});

await client.chat.completions.create({
  model: "gpt-5.5",
  messages: [{ role: "user", content: "Ship it." }],
});

await client.chat.completions.create({
  model: "claude-opus-4-7",
  messages: [{ role: "user", content: "Review this." }],
});
1 key
1 wallet
2 labs

One key for two provider families

Create a Virouter API key once, then route requests to OpenAI and Anthropic models from the same application secret.

OpenAI-compatible endpoint

Point the OpenAI SDK at https://api.virouter.com/v1 and keep the familiar chat completions request shape.

Transparent Billing USD Quota

Every successful call records input tokens, cached input tokens, output tokens, exact USD cost, and remaining quota.

Operational routing layer

Virouter validates auth, applies rate limits, forwards to healthy upstream lanes, and returns one response to your app.

Why an AI API gateway?

Stop wiring provider logic into every app.

Calling OpenAI and Anthropic directly means separate keys, separate billing surfaces, separate logs, and provider-specific failover logic. Virouter centralizes that operational layer so your product code can stay focused on the model request and response.

Your app
→
Virouter gateway
↓
OpenAI lane
or
Anthropic lane

Transparent quota

Every request returns cost visibility.

Virouter records raw input tokens, cached input tokens, output tokens, exact Billing USD cost, and remaining quota. Your dashboard and response headers show the same story.

x-virouter-cost-usd

Billing USD cost for the completed request.

x-virouter-remaining-usd

Remaining Billing USD Quota after charging.

x-virouter-input-tokens

Fresh input token count reported by upstream.

x-virouter-cached-input-tokens

Cache-read input tokens when reported.

x-virouter-cache-creation-input-tokens

Anthropic cache-write input tokens when reported.

x-virouter-output-tokens

Output token count reported by upstream.

FAQ

OpenAI + Anthropic gateway questions

Is Virouter an OpenAI and Anthropic reseller?

Virouter is a routing gateway. Your application calls Virouter, and Virouter forwards the request to configured OpenAI or Anthropic upstream channels with server-side credentials.

Can I call Claude with the OpenAI SDK?

Yes. Use the OpenAI-compatible endpoint and pass a Claude model id. Virouter converts and routes the request to the correct upstream provider.

What base URL should I use?

For the OpenAI SDK, use https://api.virouter.com/v1. For direct HTTP calls, send chat completions requests to https://api.virouter.com/v1/chat/completions.

How is quota charged?

Virouter charges against Billing USD Quota using the model catalogue price and the returned token usage. Response headers include cost, remaining quota, and token breakdown.

Use one API gateway for GPT and Claude.

Start with up to $50 in trial Billing USD Quota: $5 per rolling 24 hours for 10 periods after Telegram verification, with no rollover.