Monitor AI usage without routing a single request through Kaeso
Claude Code, Codex, Gemini CLI, LiteLLM and OpenRouter call their providers directly. With sources in Kaeso 0.7.1, they report every request instead, so usage, cost and limits cover them too.
- Published
- Reading time
- 4 min
- Author
- Kaeso Team

Most of what a team spends on models no longer goes through one place. Developers run Claude Code, Codex, Gemini CLI or Antigravity on their own machines, each with its own key and its own bill. A data team runs a LiteLLM proxy, and another service buys tokens through OpenRouter. A gateway sees only the requests that are sent to it, and you can't always send them there: the tool may not let you change where it calls, or the team behind it would rather keep its setup.
Kaeso 0.7.1 adds sources. A source lets a client keep calling its provider directly and report each request to Kaeso afterwards, as telemetry. The request never passes through Kaeso, and Kaeso logs and counts it all the same: in the request log, in usage and costs, in analytics and against the project's limits.


Observed, not routed01
A client connected to a source keeps its own provider key, base URL and model. Kaeso hears about a request only after it ended, so it never changes, delays or refuses it. Aliases, guardrails, fallbacks and the response cache don't apply to it; everything that comes after the request does.
- Request logs. Each request gets a row marked Observed, with its model, tokens, cost and duration. The Reported by filter shows what one source sent, and the Source filter all observed requests.
- Usage and costs. Observed requests count for the member or service account they belong to, in usage and costs.
- Analytics by source. A breakdown puts the gateway's own requests beside each source's.
- MCP tool calls. Calls to MCP tools that a client reports show in the tool-call log; a client's own tools, such as its shell, are left out.
- Limits and budget alerts. Observed requests count toward the project's limits and budgets, and toward each member's.


Every client people actually use02
A source has a kind, which tells Kaeso how to read what it sends. Most coding agents already export OpenTelemetry, so connecting one is a few environment variables; the console writes them out when you add the source.
| Client | What it sends |
|---|---|
| Claude Code | OpenTelemetry log events |
| Codex | OpenTelemetry log events |
| Gemini CLI | OpenTelemetry log events |
| Grok Build | OpenTelemetry log events |
| Antigravity | The model calls of its transcript, from a hook script |
| LiteLLM | The proxy's generic API logs, as JSON |
| OpenRouter | Broadcast traces |
| Any app or collector | OpenTelemetry GenAI spans or log events |
| Your own scripts | Batches of requests and tool calls in Kaeso's JSON |
Telemetry goes to /ingest on your install: OTLP over HTTP, as protobuf or JSON, or JSON batches. Every deployment template routes /ingest to the gateway.
The numbers add up03
Clients don't count the same way, so Kaeso doesn't take their numbers as they come.
- Tokens. Claude Code leaves cached input out of its input count; Codex, Gemini CLI and OpenTelemetry include it. Kaeso turns each into its own count, so a cache hit rate means the same thing for every client.
- Cost. A request costs what the project's catalogue says the model costs, or the price KPMR (opens in a new tab) has for it. Only a model neither knows keeps the cost the client reported, and its details say so.
- Duplicates. Clients send events again after a failed export. Kaeso keeps each request once, and counts a call exported both as a span and as a log event once too.
- Gateway and source together. A client that sends its requests through Kaeso and also reports them would count twice. Kaeso matches the copy to the gateway's request (same project, model and tokens, within five seconds) and leaves it out. Pointing a client at the gateway or at a source, not both, is still the clean way.
Whose requests they are04
A source counts its requests for the member or service account you choose when you add it. If people share one source, such as through Claude Code's managed settings, turn on Match members by email: an event that names a member's address then counts for that member. It's off by default, because anyone with the source key could name anyone.
Either way the person must be able to see the project, and a service account must still be active in it. A record that would count for nobody who can see the project is refused, so observed usage never lands on someone outside it.


What a source can't do05
Kaeso isn't in an observed request's path, so it can't stop one. A hard budget that observed requests use up still refuses the requests that go through Kaeso, which means a source key can spend a project's budget the way an API key can. Keep it as secret as one: it works only on /ingest, calls no model and reaches neither the Platform API nor the MCP portal, and in a source's sheet you can turn its events off or give it a new key at any time.
Prompts and replies stay out unless you want them. A source keeps the content its client sends only when Keep prompts and replies is on for it and the project keeps request content, and most clients leave content out of their telemetry until you turn it on.
Add your first source06
- 01In a project, open Sources and choose Add source.
- 02Choose the client, name the source and choose whom its requests count for.
- 03Copy the key and the setup lines Kaeso shows, put them where they go, and use the client once.
The dialog waits for the first event and shows Connected, or why Kaeso refused what arrived. The sources guide (opens in a new tab) has a page for each client, and Track Claude Code usage and costs across a team walks through the most common one.
Sources are new in Kaeso 0.7.1. To try them, install Kaeso on any server with Docker, or update an existing install from Instance › Updates.
Product names in this article belong to their owners and are used only to name the software and services involved. Kaeso is not affiliated with or endorsed by them.
By Kaeso Team


