AI gateway and observabilitySelf-serve

# Vatan Gateway

One endpoint in front of every model, with per-key rate limits, a credit balance that refuses at zero, and every call metered with its tokens, cost and outcome.

[Create an account](https://vatan.one/signup)[See pricing](https://vatan.one/pricing)

The problem

## Four teams with four provider keys is four bills, four safety opinions and no answer to what the organisation spent or sent.

Deployed

Deployed and taking traffic, in one region. No usage or availability figure is published, because none has been measured over a meaningful period; the status page checks the endpoint live instead. A key's budget runs over a calendar month in UTC or over the life of the key. It is checked before a request and counted after it, so a key can pass its budget by one request and cannot start another.

“We had a budget and blew through it 3 times as fast as we anticipated.”

Partner, Professional Services, Large EnterpriseQuoted in Qualitate’s report [How are enterprises trying to control token spend?](https://www.qualitate.io/resources/intelligence/enterprise-token-spend-mitigation), 22 July 2026, from 1,500+ model provider expert discussions. Qualitate does not endorse Vatan.

Outside research

## Three of its tactics, and what the gateway does for each.

**Routing tasks to cheaper models**Every model is behind one endpoint and one key, so moving a task is a change of model name.

**Prompt caching and templating**A response cache that does not charge a cached answer, and named prompts with numbered versions.

**Token budgets and usage caps**A spend cap and a rate limit on each key, checked before the provider is called.

See how it works

## Two lines. Every call metered.

The problem a gateway solves, the two lines that repoint an app, and what the requests, routes and spend screens show after.

Watch the gateway demo

85 seconds, silent, with the text on screen.The console screens are examples, not a customer account.

How a request moves

## Checked before it costs anything, routed until it lands.

Limits and balance are checked before any provider is called. The route then tries its models in order, and every attempt is logged without the words in it.

**YOUR APPLICATION**One endpoint, one key

**BATCH QUEUE**At the provider's batch price

**VATAN GATEWAY**

**BEFORE THE PROVIDER**Rate limit and spend capper key, checked first

**PREPAID**Balance above zero?at zero: 402, nothing sent

Redactioncard numbers, IBANs, API keys

Response cachea hit is not charged

Prompt registrynumbered versions

**ROUTE**Try the models in orderon a rate limit, an overload or a server error, move to the next

Model 1

Model 2

Model 3

A log of every callmodel, tokens, time, cost, status; no prompt, no reply

A trace of every attempteach model a routed request tried

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.

Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

What it does

## Built around what production actually requires.

One endpoint, one wire formatAn OpenAI-compatible endpoint for chat and embeddings, in front of every model this deployment serves, on one key and one bill.An OpenAI-compatible chat completions endpoint with streaming, and an embeddings endpoint beside it. Both share one key, one balance and one usage record. An existing client reaches it by changing a base URL and a key. The model catalogue is readable without a key, and the models page prints it as the gateway answers it.

Pictures, speech and videoImage, speech, transcription and video models answer on the same key and balance as chat.Video is charged once, when it finishes, and a job that fails costs nothing. Each call is refused before it starts if the balance cannot cover the worst case.

Limits enforced before the providerA key per application, issued and revoked by you, each with its own rate limit and spend cap, checked before the provider is called.A key can carry its own requests-per-minute and tokens-per-minute ceiling, checked before anything leaves the estate. A request over the limit costs nothing upstream and cannot spend the capacity the other keys are sharing. A new key has neither set, so nothing is imposed that you did not choose.

A balance that refuses at zeroPrepaid credit, drawn down per request. At zero the gateway answers 402 and stops, so nothing depends on somebody reading a warning in time.Credit is prepaid and drawn down per request, against the same rows the usage page reads. At zero the gateway answers 402 and stops. There is one balance per workspace. A key can also carry its own spend budget, monthly or for the life of the key. Reaching it stops that key and leaves the balance and every other key alone. A team carries one cap that every key in it draws on, checked before the key's own. Spend can be grouped by issuer. There is still no per-PERSON cap. A key is a bearer credential, so a colleague using a key somebody else issued spends against that key and shows up against the issuer.

A log with no content in itEvery call records its model, tokens, latency, cost and status, and that record holds no prompt or completion text.That record has no column for prompt or completion text, which is checkable in deploy/migrations/020_routing/002_usage.sql, and there is no export or streaming of it to anywhere else.

Routes that fall throughA route names an ordered list of models and moves to the next one on a rate limit, an overload or a server error.A route is a name you call instead of a model. It stops on anything a second attempt only repeats: a malformed request, a refused key, a model that does not exist. It also stops the moment a model produces output, because a completion bills and walking past a good answer charges you twice for one of them.

Redaction of shaped identifiersCard numbers, IBANs, national ID numbers, email addresses and API keys, masked or refused before a request leaves, and off until you turn it on.Shaped identifiers are masked or refused before a request leaves the estate, per detector, your choice per organisation. It finds card numbers that satisfy Luhn, IBANs that satisfy mod-97, National Insurance and Social Security numbers, email addresses and API keys. It cannot find names, addresses or anything written in prose, and no pattern-based redaction can. Treat it as a second line under a rule about what goes in the prompt, never as the rule itself.

A response cache, off until you chooseExact or semantic matching, off until you choose a mode, and a request answered from the cache is not charged.Switch it on for the workspace and a repeated request is answered from the stored completion and is not charged. Identical means byte-identical after ordering the fields, so it catches a retry, a poll and a hot path replaying the same question. A semantic mode matches a reworded question instead, on a similarity you set, and every semantic hit says how close it judged them so you can disagree with the judgement. A request's own cache setting always wins over the workspace's.

A prompt registryNamed prompts with numbered versions, and a published version cannot be edited.A prompt is stored under a name with numbered versions, called as name@3. A published version cannot be edited, so a change is a new version and never a silent rewrite of what ran yesterday. A missing variable at fill time is an error, not a blank.

A batch queue at the provider’s batch priceChat completions queued and metered like a live call, at the provider’s own batch price.A batch names a model id ending :batch and runs at the provider's own batch price, on 29 chat models. Each lists its batch price beside its ordinary one, because the discount varies. It bills to your own key, balance and budget. An OpenRouter batch cannot be stopped once sent. A model without a batch price is refused at creation.

A trace of every attemptEach model a routed request tried, with the status, time and cost of every attempt.It records no prompt or completion text, except a failed attempt's provider error, which can quote the request.

[How we handle your dataHeld in Germany, sent to the model you choose, and encrypted per workspace where it is kept.](https://vatan.one/data)[You do not have to bet on one AI providerChanging models should be a one-word edit.](https://vatan.one/blog/you-do-not-have-to-bet-on-one-ai-provider)

You pay per token from a prepaid balance, and nothing else. Caps, the fast model first, caching and batch rates are there to cut your bill, not grow it.

Proof points

## What it means for your spend.

#### One metered place

Everything you send through the gateway is metered by key, by model and by whoever issued the key.

#### Know what it costs

Every call records its cost, and a routed call records every attempt it made.

#### Spend less on the same work

Auto uses a fast model unless a request asks for reasoning, real work, many tools or a long context.

#### Access through keys and teams

Keys carry budgets, rate limits and IP allowlists. Teams carry a shared cap and their own permissions.

## Put Gateway in front of your own traffic.

Create an account, issue a key and change a base URL. The first call is metered and readable the same minute.

[Get in touch](https://vatan.one/contact?reason=gateway)[See pricing](https://vatan.one/pricing)

Source: https://vatan.one/products/gateway
