Skip to main content
For the complete documentation index for agents and LLMs, see llms.txt.

View Cost and Quality Trends on the AI Operator PageBeta

Beta
This is coming โ€” this page describes a feature that's still being rolled out and may not be available to you yet.

To find out whether a release or an accepted AI Operator suggestion changed what a Service costs per conversation, use the Service Cost History card on the Service's AI Operator page. It charts the Service's own production traffic and marks each release on the day it went live.


About This Taskโ€‹

You see the Service Cost History card, and the cost figure in its header, only if you have the costs:read permission. If you don't see them, ask your workspace admin for access. The Service also needs an AI Operator; see Set Up an AI Operator for a Service.

The card sits above the run cards, next to the Runs table. The figure beside the card title is the Service's live cost per conversation over the past week. It is the latest point of the chart, so the two always agree. Today is still in progress, so the latest point and the header figure can change during the day. To learn about the Runs table, see View Past Runs.

Chart Elementsโ€‹

The chart is built from the production conversations of the Service, not from optimization replays. It draws the cost line and the daily conversations in one plot, each on its own axis: cost per conversation on the left, conversations per day on the right. It includes:

  • 7-day average: a line showing the cost per conversation as a rolling average, read on the left axis. Each point is the cost of the 7 days up to that day divided by the number of conversations in those days, so a quiet day counts only in proportion to its traffic.
  • Low sample: segments of the line drawn dashed where the 7 days behind a point hold fewer than 20 conversations. Treat these segments with caution, because little traffic makes the average noisy.
  • Conversations per day: bars read on the right axis. They show daily traffic, so you can see whether a move in the line comes with a change in traffic and judge how much to trust it. Today's bar is fainter because the day isn't over.
  • 7-day window: hover over a day to see which 7 days its point averages over.
  • Release: a dashed vertical line on the day a version went live, labeled with its version, for example v345. Rollbacks get a line too. Releases on the same day share one line, for example v328โ€“v334. Revisions that never served traffic, such as failed deployments, and re-activations of the version that is already live don't get a line.
  • Accepted suggestion: a green dashed line for a version created by accepting an AI Operator suggestion. Its label shows how much the version changed cost per conversation compared with the version live before it, for example v274 ยท โˆ’51%.
  • Tooltip: hover over a day to see the date, the cost per conversation, and the number of conversations in the 7-day window and on that day.
  • Range selector: switch between 30d and 90d. The default is 90d. If the Service's data starts later than the range, the chart starts where the data starts.

Read the Chartโ€‹

  1. Open the Service and go to its AI Operator page.
  2. Find the Service Cost History card.
  3. Select 30d or 90d so the range covers the releases you want to compare.
  4. Compare the line against the release lines to see whether a change in cost per conversation lines up with a specific release.
  5. Check the bars and dashed segments before you draw a conclusion. A change on days with few conversations is a weak signal. For example, a cost spike on a few conversations may come from one long conversation.
  6. For a green line, read the percentage in its label to see how much the accepted suggestion moved cost per conversation.
  7. If cost per conversation keeps rising after a release, start an optimization run; see Start an Optimization Run.

If the chart shows no production conversations yet, the Service has had no traffic in the selected range. Check again after the Service has handled conversations. If release lines look off by a day or sit at a revision's creation date, the Service's activity log hasn't loaded yet or couldn't be read; refresh the page.

What an Optimization Run's Cost Includesโ€‹

An optimization run's cost covers everything the run set off, counted at the moment it started. Use this when a run's total looks higher or lower than you expect.

  • Repeated work counts. If a suggestion is replayed again, or the baseline or a suggestion is evaluated again, the earlier attempts stay in the cost. Replayed turns are counted one by one, so a test case that stopped partway still counts the turns that ran. An optimizer call that returned no suggestions also counts.
  • Reused work isn't counted twice. When a run reuses baseline replays or earlier evaluation results, the run that paid for them first carries their cost.
  • Recent turns can appear late. A replayed turn is counted once its token usage is written, which usually takes a few seconds.
  • Optimizer calls are billed to the optimizer's workspace. Its cost still appears in the run's total.

To read the same breakdown in your own tooling or scripts, call the run's spend endpoint, GET /api/v2/workspaces/{workspace_id}/deployments/{deployment_id}/optimization-goals/{goal_id}/runs/{run_id}/spend. It returns the total, the cost of each of the five phases, and the cost of each suggestion's replay and evaluation. For a run that started before spend was recorded, the total is null because the cost is unknown, not zero.