Skip to content

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
A bright gradient of orchid and pink, in gentle level folds, with a warm light in one corner

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.

The Sources page of a project, listing Antigravity, Claude Code, Codex, Gemini CLI, Grok Build, LiteLLM, an HTTP script, OpenRouter and an OpenTelemetry app, each with its events a day and Connected, and one source still WaitingThe Sources page of a project, listing Antigravity, Claude Code, Codex, Gemini CLI, Grok Build, LiteLLM, an HTTP script, OpenRouter and an OpenTelemetry app, each with its events a day and Connected, and one source still Waiting
Fig. 01A project's Sources: each client that reports to Kaeso, when it last did, and its status.

Observed, not routed

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.
Analytics broken down by source: the gateway's requests beside an HTTP script, Claude Code, Codex, Gemini CLI, Antigravity, LiteLLM, OpenRouter, an OpenTelemetry app and Grok Build, each with its requests, errors, tokens, cache hits and costAnalytics broken down by source: the gateway's requests beside an HTTP script, Claude Code, Codex, Gemini CLI, Antigravity, LiteLLM, OpenRouter, an OpenTelemetry app and Grok Build, each with its requests, errors, tokens, cache hits and cost
Fig. 02Analytics › By source: what each client used, next to the requests that went through the gateway.

Every client people actually use

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.

ClientWhat it sends
Claude CodeOpenTelemetry log events
CodexOpenTelemetry log events
Gemini CLIOpenTelemetry log events
Grok BuildOpenTelemetry log events
AntigravityThe model calls of its transcript, from a hook script
LiteLLMThe proxy's generic API logs, as JSON
OpenRouterBroadcast traces
Any app or collectorOpenTelemetry GenAI spans or log events
Your own scriptsBatches 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 up

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 are

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.

The request log filtered to observed requests: Grok, GPT, Claude and DeepSeek requests, each with the Observed tag, one marked Provider errorThe request log filtered to observed requests: Grok, GPT, Claude and DeepSeek requests, each with the Observed tag, one marked Provider error
Fig. 03The request log, filtered to observed requests.

What a source can't do

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 source

  1. In a project, open Sources and choose Add source.
  2. Choose the client, name the source and choose whom its requests count for.
  3. Copy 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

On this page

Own the gateway.Own the record.

curl -fsSLhttps://kaeso.app/install.sh | sh