Measure the whole CometAPI agent run before changing models

A small final prompt can hide a large bill. CometAPI’s official agent-cost guide says to count every model call: repeated instructions, growing history, tool results, retries, reasoning, and subagents.

Record rendered input/output tokens, cached input, retained tool-result tokens, retry reasons, compaction size, route, and acceptance for each step. Use cost per successful task—not price per request—as the primary metric.

In the guide’s hypothetical 12-call example, a 4,000-token stable prefix plus 1,500 new tokens per step produces 147,000 cumulative input tokens, although the final call contains only 20,500. This is planning arithmetic, not a benchmark.

Control the loop before changing models: set run-level limits; filter tool results structurally; compact state while preserving decisions and evidence IDs; stabilize reusable prefixes for caching; and bound retries and fallback. Caching can lower the effective price of repeated input, but it does not reduce context size.

Only then compare CometAPI routes on the same evaluation set. Verify current catalog availability and account-visible pricing, and measure acceptance rate, p50/p95 latency, retry tax, and cost per accepted output. Labels such as “cheap” or “fast” are application policy, not universal rankings.

For the CometAPI comparison, the guide points to its pricing page and cost-estimation guidance to separate input, output, cached-token, and reasoning costs, then its model catalog to choose eligible routes. Its routing guide makes fallback attempts explicit rather than treating a successful final response as the whole cost. These are application-owned controls: unified model access does not itself enforce a run budget or preserve useful state during compaction.

The useful comparison is not “which route costs less per call,” but “which route lowers cost per accepted task under the same loop.” I would freeze an evaluation set and log a per-run ledger with at least: route and model version, rendered input/output tokens, cached input, reasoning tokens when exposed, tool-result retention, retry/fallback attempts, latency, and whether the output passed the acceptance check. Then report total spend divided by accepted tasks, alongside p50/p95 latency and acceptance rate.

That denominator matters because a cheaper route that needs more retries—or produces answers that require an additional repair call—can have a higher effective cost. Keep the controller policy fixed while comparing routes: identical context filtering, compaction rules, retry budget, and stopping criteria. Otherwise the experiment measures two different agents rather than two model routes. Recheck catalog availability and account-visible prices at test time; route labels are time- and workload-dependent rather than universal properties.