Back to Blog
Product Update2026-08-06

AI SpendOps Now Supports Vercel AI Gateway

Vercel AI Gateway is now a supported provider in AI SpendOps. If your application routes model calls through the gateway, you can put AI SpendOps in front of it and add finance-grade cost attribution, budgets and governance on top, without giving up anything the gateway does for you. It is a one-line base URL change, and your existing gateway key stays exactly as it is.

Full setup instructions are in the Vercel AI Gateway documentation.


Two layers, two jobs

Vercel AI Gateway is a strong piece of engineering. One endpoint, hundreds of models across every major creator, automatic fallbacks when a provider wobbles, and per-request cost reported in-band so nothing has to be estimated. Teams adopt it for good reasons, and this integration is not an argument to move off it.

What we add sits above that, and it answers a different question. The gateway is built for the engineers running the traffic. AI SpendOps is built for the conversation that happens when the invoice reaches finance:

  • Which team, feature, environment and customer generated this spend? Dimension headers attribute every request, and you can make them mandatory per API key so nothing reaches production untagged.
  • What is our gross margin on this product line? Cost per customer and per feature, rolled up the way a P&L is read rather than the way a request log is read.
  • Are we going to overshoot this month? Budgets with multi-level warnings, burn-rate projection and email alerts, so finance hears about an overshoot before the invoice does. Model and provider policies are enforced at the edge before the request goes anywhere.
  • What is the whole AI bill, not just the gateway part? Gateway traffic sits in one dashboard alongside your direct OpenAI, Anthropic and Google calls, across 16 providers.

Put simply: keep the gateway's routing, reach and resilience, and add the reporting layer a CFO can actually sign off. The two are complementary, and running both takes one config line.


What changes in your code

One base URL, one header. The gateway supports two SDK families, and they take slightly different URLs:

from openai import OpenAI

client = OpenAI(
    api_key="vck_your_gateway_key",                                # unchanged
    base_url="https://proxy.aispendops.com/v1/vercel/v1",          # point at AI SpendOps
    default_headers={"X-ASO-API-Key": "aso_k_xxx.yyy"},            # your AI SpendOps key
)

response = client.chat.completions.create(
    model="anthropic/claude-sonnet-5",
    messages=[{"role": "user", "content": "Hello"}],
)

The Anthropic Messages shape works too, at https://proxy.aispendops.com/v1/vercel, with full Anthropic cache semantics preserved including the 5-minute and 1-hour cache write split. Streaming responses carry usage automatically, so there is no stream_options flag to remember.


Cost comes straight from the gateway

Most providers report tokens and leave the pricing to us. The gateway reports the charged amount in-band on every response, streaming and non-streaming, so AI SpendOps records what you were actually charged rather than a calculation from published rates.

We verified this against live billing before shipping, across models from three different creators, and the reported figure matched list price exactly. That is a nice property to inherit: no markup to reason about, no rate card to keep in sync, and new models are priced correctly the day Vercel adds them.

If you use Vercel's bring-your-own-key option, the accounting works slightly differently, since your provider bills you directly rather than through the gateway. AI SpendOps records those requests distinctly so they are easy to identify, with tokens captured in full and the list-price value of the consumption retained. The provider guide covers the detail.


Policy applies to fallbacks, not just the model you asked for

One of the gateway's better features is fallback models: pass a list, and a request survives a provider outage instead of failing. Resilience like that is worth having, and it means the model that runs may not be the model you named, which is something any spend policy needs to account for.

AI SpendOps validates every entry in that list against your key's policy, not just the primary model. A key restricted to anthropic/* cannot reach an OpenAI model through a fallback. If any entry fails the check, the request is denied before it leaves the edge. And when a fallback does serve the request, the gateway reports the model that actually ran, so billing attributes to the right one.

Because every gateway request arrives under a single provider, you use model allow-lists rather than provider allow-lists to separate creators. Spend still breaks down by creator, since the model name carries it.


Available now

Vercel AI Gateway is live in production for all plans. Point your base URL at the proxy, add your AI SpendOps key, and your next request shows up attributed.

Read the full Vercel AI Gateway guide, or start with your first 3 months free.