OpenRouter cost tracking
Price calls through OpenRouter at each model's list price, attribute them to customers, and reconcile with OpenRouter's spend.
By Keyveve, Inc. · Updated 2026-10-23
Point the OpenAI client at OpenRouter and wrap it. Each call is priced at the underlying lab's list price and counted toward OpenRouter's bill, so reconciliation compares it with what OpenRouter charged, fees included.
Wrap the client
import veqen
from openai import OpenAI
veqen.init() # reads VEQEN_API_KEY, an ingest key
client = veqen.wrap(OpenAI(base_url="https://openrouter.ai/api/v1", api_key=OPENROUTER_KEY), feature="chat")
with veqen.tags(customer=org.id):
client.chat.completions.create(model="anthropic/claude-sonnet-4.5", messages=messages)
import OpenAI from "openai";
import { wrap } from "@veqen/sdk";
const client = wrap(new OpenAI({ baseURL: "https://openrouter.ai/api/v1", apiKey: process.env.OPENROUTER_KEY }), { feature: "chat" });
Without code changes
OpenRouter's Broadcast can send every request's usage to Veqen over OpenTelemetry, with customer and feature from the request's trace metadata: see Track OpenRouter costs with Broadcast.
Reconcile to the bill
Add an OpenRouter connection under Settings › Connections with a management key. Veqen imports spend per model from OpenRouter's activity API (the last 30 days) and compares it with what you tracked. The difference is mostly OpenRouter's fees and any provider price differences.
Next
Veqen records what every AI request cost and who it was for, checks it against your provider bills and prepares the entries for your accounting system. Start free or read the quickstart.