OpenAI cost tracking
Price every OpenAI call exactly, from chat and the Responses API to images, audio and embeddings, and reconcile it to OpenAI's bill.
By Keyveve, Inc. · Updated 2026-10-23
Wrap the OpenAI client once and every call is priced at OpenAI's list rates: cached input, Batch, Flex and Priority processing, long-context tiers, images by size and quality, speech, transcription and embeddings.
Wrap the client
import veqen
from openai import OpenAI
veqen.init() # reads VEQEN_API_KEY, an ingest key
client = veqen.wrap(OpenAI(), feature="chat")
with veqen.tags(customer=org.id):
client.responses.create(model="gpt-5-mini", input=question)
import OpenAI from "openai";
import { wrap, withTags } from "@veqen/sdk";
const client = wrap(new OpenAI(), { feature: "chat" });
await withTags({ customer: org.id }, () => client.responses.create({ model: "gpt-5-mini", input: question }));
Prompts and responses never leave your process: the wrapper reads only the usage OpenAI returns.
Reconcile to the bill
Under Settings › Connections, add an OpenAI admin key with read access to usage. Veqen imports billed cost per model from OpenAI's Costs API every few hours and compares it with what you tracked, so you see the capture rate and any gap by model.
Next
- Python and JavaScript SDKs.
- Reconciliation: reading the capture rate.
- OpenAI model prices.
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.