Financial agent API cost accounting

Updated 2026-09-05

Measure the complete research job, not one reply. Join model usage to source processing, quantitative computation and review outcomes before comparing workflows.

Choose the unit of work before estimating cost

Define whether you are measuring one company brief, one earnings comparison, one watchlist update or one quantitative experiment. A multi-agent application can make many model requests inside that unit. Separate tasks that completed technically from artifacts accepted by a reviewer. Cost per accepted artifact captures retries and rejected work that a cost-per-response metric misses. Keep the task definition stable when comparing models, otherwise a cheaper run may simply have read fewer sources or skipped a required review stage.

Financial research workflow: collect public sources, extract facts, calculate and reconcile, generate cited explanations, and review the result.
Workflow illustration. Source-linked research and review are separate from trade execution.

Maintain a request ledger joined to the job

Record job identity, stage, model role, requested model, observed request identity, attempt number and final status. Retain token usage and the applicable billing record when available. A client timeout does not prove that no computation occurred or that the request was free. Keep an unresolved billing state until it can be reconciled. Never put keys, private prompts or complete licensed source documents into a cost ledger that will be shared with a wider audience.

{
  "job_id": "REQUIRED",
  "stage": "research_synthesis",
  "model_role": "review",
  "requested_model": "CURRENT_CATALOG_MODEL_ID",
  "request_id": null,
  "attempt": 1,
  "input_tokens": null,
  "output_tokens": null,
  "charge": null,
  "billing_status": "unreconciled",
  "artifact_status": "pending"
}

Apply the actual billing contract

Use the current pricing source for the selected model and record its version or retrieval date with the estimate. Distinguish ordinary input, cached input, output and any other billed categories according to that contract. Do not double-count a cached subset already included in total input. Official provider prices and gateway charges are different contracts; neither should silently replace the other. If a response lacks usage, use authoritative billing evidence when available and retain the uncertainty until then.

Cost itemEvidence to retainCommon mistake
Model requestUsage categories and billed amountApplying an unrelated provider price
RetryAttempt and parent request identityDropping failed but billed attempts
CacheCache semantics and billed categoryAssuming local reuse is a billing discount
EmbeddingModel, input scope and chargeCounting it as ordinary chat
Unresolved requestStatus and reconciliation taskReplacing unknown cost with zero

Account for the non-LLM parts of financial research

Add financial-data access, document extraction, storage, local computation and human review as separate categories. A Qlib experiment or FinRL training run can consume substantial resources without making a chat request. A FinGPT notebook can combine remote agent conversation with local sentiment inference. Keeping those paths distinct explains where optimization can help. When reporting shared subscription or infrastructure costs, state the allocation method rather than pretending each task generated an independently billed charge.

Understand why multi-agent costs multiply

TradingAgents has separate model roles and iterative research stages; the total depends on the actual source volume and configured rounds. Other frameworks add coordination, retrieval, retries or repeated code revisions. Count these operations from logs rather than estimating from the number of named agents. The same long filing may be repeated in several prompts. Inspect where the context is reused and whether each extra review produces a distinct acceptance benefit. A larger graph is not automatically a more economical or more accurate research workflow.

Reduce repeated work while preserving evidence

Extract documents once per source and parser version, then pass bounded evidence packets to downstream stages. Reuse deterministic calculations by input and formula identity. Cap debate rounds and retry attempts, and choose model roles according to the actual task requirements. Validate the effect on accepted output, not just the request count. Aggressive summarization may omit the caveat that matters most; cache reuse may serve an outdated filing. Every optimization needs a way to detect stale inputs and preserve the original source for review.

Compare workflows on the same task packet

Use the same issuer set, cutoff, source packet and acceptance criteria. Record completed artifacts, rejected artifacts, partial jobs and human corrections. Compare the resulting distribution of task costs rather than selecting one favorable run. For a scheduled watchlist, separate unchanged events from new-source events because their work differs. For quantitative research, include the number of attempted hypotheses and local compute. Publish the configuration and evidence boundaries alongside any later measured figure so another reviewer can tell what the comparison actually covers.

Evidence and measurement status

This page supplies an accounting method, not a measured price-per-report or a current model-price table. Official project sources establish the different runtime responsibilities; the current pricing page supplies commercial terms. No APIsRouter finance workflow usage ledger was generated for this guide. A measured case should include redacted request evidence, reconciled charges, non-model resource costs and an accepted artifact count.

FAQ

How much does one TradingAgents analysis cost?

It depends on the actual models, source volume, rounds and retries. Run a bounded task and reconcile its request ledger instead of assuming a universal per-analysis figure.

Should failed requests be counted?

Include them when billing evidence shows a charge. Keep uncertain attempts unresolved until reconciliation rather than assigning them zero cost.

Does application caching reduce the provider price?

Not necessarily. It may avoid a request entirely, while provider prompt caching has its own billing semantics. Record which mechanism actually occurred.

Are Qlib and FinRL costs part of the API bill?

Their core computation is a separate resource category. An attached LLM agent may also incur API charges, which should be joined by experiment identity.

What is the fairest comparison denominator?

Use a clearly defined accepted artifact or experiment, with failed attempts and review work included under a stated allocation method.