Agent Router spend as a context stream
Prism holds Agent Router spend as a context stream named Agent Router spend. A query on it can group spend by account, by API key, by model and by month.
Nothing in this release reads the stream. The chat assistant answers a
spend question with the Agent Router spend tools, as before. No dashboard
tile reads the stream yet. This page describes the stream so that you know
what the name spend now means on your install.
When Prism serves the stream
Prism serves the stream only when sources.spend is indexed.
- With
indexed, Prism copies the Agent Router's request log into its own memory on a schedule. The stream is over that copy. - With
live,syntheticor no value, there is no such copy and no such stream.
You do not register this stream, and it has no row on Context streams. You cannot edit its columns. Prism ships them.
The name spend belongs to this stream. Prism refuses to register or rename
another context stream as spend. If you already have a context stream of
your own named spend, the name stays that stream's, whether your stream is
switched on or off. Prism then does not serve its own stream. Rename yours to
free the name.
How fresh the stream is
ingest.spend.staleAfterHours decides when Prism calls the copy stale. The
stream and the Agent Router spend tools read the same value, so they agree.
The default is 24 hours.
What the stream holds
One record is one day, one Agent Router account, one API key and one model.
| Field | What it is |
|---|---|
day | The UTC day of the requests. Group it by day, week, month, quarter or year |
user_id | The Agent Router account that spent |
api_key_name | The name the Agent Router holds for the API key |
api_key_id | The Agent Router's id for the API key |
model | The model's name, as the Agent Router reports it |
model_family | The model's name without the provider in front and without the release date or the deployment version at the end. claude-sonnet-4-5-20250929 and us.anthropic.claude-sonnet-4-5-20250929-v1:0 are both claude-sonnet-4-5 |
| Measure | What it adds up |
|---|---|
cost | The Agent Router's recorded cost, in US dollars |
requests | Model requests |
input_tokens | Input tokens, cached and uncached |
output_tokens | Output tokens |
errors | Model requests that ended in an error |
cost adds up every billing mode. Managed cost is what the Router billed.
Pass-through cost is an estimate priced per token. BYOK cost is the Router's
fee, or the provider's list price plus the fee. So a total is not a provider
bill. Call it Router spend across all billing modes.
The stream does not hold billing mode as a field, and it does not hold latency. The Agent Router spend tools still answer those.
How spend reaches a person
Prism links an Agent Router account to a person by the account's email
address. Each nightly copy asks the Agent Router for each account's email.
Prism matches that address to a person in your organizational context
stream. Agent Router credentials says what the copy
needs, and how to turn the email read off with
ingest.spend.routerAccountEmails.
- A person with two Agent Router accounts has one row. The row is the sum of both accounts.
- An account that Prism cannot link to a person is in no person's row. A
breakdown by person shows that spend in one row named
(unresolved), so the rows still add up to the total. - Requests that carried no account are held under
(unattributed). They are in the(unresolved)row too. - A person's row holds every API key on their accounts. A key that a team shares shows as the spend of the one person who owns the account.
People limited to their reporting line
A person can be limited to their own reporting line (Restrict what a viewer sees). Prism does not serve Agent Router spend to such a person.