AI agent cost Module
The principle — an agent is measured in usage, not hours
An agent has no timesheet: its capacity is never hours, and its consumption is not counted like a human's. It is measured in model usage — the volume of text processed by the large language model that drives it. Vaks PM turns that usage into a money amount on two distinct counts: what the agent costs you (internal cost) and, where relevant, what you charge a client (selling price). Both feed the same profit & loss view as human work.
Tokens or credits — two units depending on the provider
The unit depends on how the model's provider bills, and Vaks PM picks it automatically:
| Unit | For which agents | What is counted |
|---|---|---|
| Tokens (per 1,000) | Token-billed models — Anthropic, OpenAI, Mistral, and any model reached through an API or a gateway. | The number of tokens (the unit a model counts text in) in and out — since output typically costs 3 to 5 times input, the two are counted separately. |
| Credits (per 1,000) | Message/credit-billed agents — typically Microsoft Copilot Studio. | The number of Copilot Credits consumed. The underlying model is included in the credit: there is no input/output to separate. |
Internal cost — what the model costs you
An agent's internal cost is derived from configurable rates, set on the agent's profile (Cost tab):
- Two rates for a token-billed agent: one per 1,000 input tokens and one per 1,000 output tokens — because an LLM's output costs several times its input. A run then costs
input_tokens/1000 × in_rate + output_tokens/1000 × out_rate. - One credit price for a Copilot agent: an amount per credit (set globally in policies, see estimate), multiplied by the number of credits measured.
These rates need not be typed in model by model: the price catalog pre-fills them for known models.
Billing a client — a separate selling price
The internal cost (what you pay) and the billed price (what you sell) are two independent values, deliberately decoupled. The selling price is a single rate per 1,000 units (tokens or credits, input and output combined) — a commercial price, unrelated to the provider's cost structure. An agent with no billing rate is simply non-billable: its internal cost is still tracked, but nothing goes to revenue.
Rate resolution — from most specific to default
For a given project, the rate applied to an agent resolves in priority order:
- The agent's rate on this project — an override set project by project (under the project's finance), when a client negotiates a specific price.
- The agent's default rate — the one on its profile, applied everywhere else.
- Non-billable — with neither, the agent's work generates no revenue (the cost is still always tracked).
Where the number comes from — three sources
Knowing a run's real cost means knowing its real usage. Vaks PM accepts that figure in three ways, from simplest to most reliable. They do not exclude each other — a real measured or declared figure is never overwritten by an estimate.
| Source | Who provides the usage | Reliability |
|---|---|---|
| Declared | The agent itself, after each run. | Depends on the agent's honesty — Vaks keeps a reference cost to cross-check it. |
| Measured (gateway) | A gateway the model calls pass through. | Exact: usage is read from the provider's own response. |
| Estimated | Vaks PM, from the agent's observed activity. | Approximate — the fallback when cost is not measurable (Copilot credits). |
Declared — the agent reports its usage
After working, an agent declares its run cost: the number of input and output tokens (and optionally an already-computed cost). If the agent supplies only tokens, Vaks PM derives the cost from its rates — and always keeps that derived amount as an anti-cheat reference: a declared cost that strays too far from what the tokens imply is flagged as an anomaly. The declared cost wins, the reference is the guardrail.
Measured — the LLM gateway
For an exact measure that does not depend on the agent's declaration, Vaks PM provides an optional LLM gateway: a lightweight relay, deployed on the client side as close to the agents as possible, that the model calls (Anthropic, OpenAI and compatibles) flow through. The gateway reads the real usage from the provider's response and reports it to Vaks PM, marked as measured. The agent declares nothing.
Estimated — credit-billed agents (Copilot)
Some agents are not measurable in tokens: a Microsoft Copilot Studio agent is billed by Microsoft in credits, and the per-call detail is not exposed in tokens. So this cost does not escape the P&L, Vaks PM estimates it: it counts the agent's activity — a baseline per task, plus an increment per tool call — in credits, then converts them to money via the credit price you set.
credit price in policies. This is the most commonly missed setting. The credit cost Vaks estimates is a mirror of the Microsoft bill — the actual billing stays with Microsoft (see a Copilot agent's cost).
The model price catalog
Converting tokens into money means knowing each model's price. Vaks PM keeps a price catalog that serves two purposes: offering the list of models when creating an agent, and pre-filling its internal cost rates.
Shipped offline
A base list of models and their prices is embedded in the product and shipped with every update. A fully air-gapped instance therefore has default prices with no outbound access at all.
Two online sources
If refresh is on, prices come from OpenRouter (a usage-ranked model list + prices), falling back to LiteLLM when a price is missing. These are third-party sources, independent of Vaks PM.
Cumulative, never purged
The catalog is additive: a model that drops off a source is not deleted. The list offered to the picker applies a 4-year retention (last seen), to avoid clutter from obsolete models while keeping price history.
Refresh — optional and opt-in
Online refresh is off by default. An administrator turns it on with a toggle in policies; it then runs about once a day, adds or updates prices, and flags drift when a price moves significantly. Two guardrails:
- A hand-set price is never overwritten. If you set a model's rate yourself, the feed respects it — it only touches what it set itself.
- The network must be open. Refresh reaches
openrouter.aiand LiteLLM's price repository. On an instance with no internet egress, leave it off and rely on the offline-shipped list (which can be extended by hand).
Where the cost shows — P&L, reports, exports
Once known, an agent's cost (and revenue) joins the rest of finance, alongside human work:
- Project profit & loss — agents' real cost enters the project cost, their forecast enters the estimate-at-completion, and billed agent revenue enters revenue.
- Project & portfolio reports — agent cost and revenue are broken down by project and client, with an “of which AI agents” sub-line.
- Exports — CSV, spreadsheet (XLSX) and PDF carry the agent breakdown.
Where to configure
| Setting | Where |
|---|---|
| Internal cost rates (in/out per kToken, or credit price) and the agent's default billing rate | Admin → Users & Identity → Agents → the agent's profile, Cost tab |
| An agent's rate on a project (override) | Project finance — “AI agent rates” card |
| Measurement source (gateway secret) · Copilot estimate + credit price · price feed (toggle) | Admin → AI Agent Management → Policies |
| Model catalog & prices | Admin → AI Agent Management → Policies — browsable, prices applicable to an agent |
| Usage & cost ledger | Admin → AI Agent Management → Usage & cost ledger |
See also: AI agents — cost & billing (overview) · Autonomous Copilot agent — the execution cost · Agent directories (rates at inbound registration) · all integrations.