Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

docs: add TokensUsage Wire Records page to nav, fix changelog link path

Louis Choquel005c61338d5e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9e59f6302..17b623bb8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,7 @@
### Added
- **Durable runs now persist token usage: the delivery executor writes a `tokens_usages.json` result artifact** (`{"tokens_usages": [...], "usage_assembly_error": null}`) alongside `working_memory.json`, the `main_stuff.*` renders, and the graph outputs. The records use the client-facing `TokensUsageRecord` wire shape — the same shape the `/execute` response carries on `pipe_output.tokens_usages` — so a client polling a durable run's result files reads costs the same way a sync `/execute` caller does. The artifact is written unconditionally: a run with usage assembly off yields explicit nulls, distinguishable from a pre-artifact run (file absent).
-- **`TokensUsageRecord` — a deliberate client wire shape for token usage** (`pipelex/reporting/usage_records.py`). One flat record per inference call: `model_type`, `inference_model_name`, `inference_model_id`, `pipe_code`, `job_category`, `unit_job_id`, `nb_tokens_by_category` (raw provider counts), computed USD `cost` (`null` when the model has no rate table), and ISO `started_at`/`completed_at`. Enum-ish fields are open string sets on the wire, so runtime enum churn is non-breaking for clients. `compute_tokens_usage_cost` reuses the existing cost engine (`model_cost_per_token` + the cached/non-cached split), so the wire `cost` equals the CLI cost table's total for the same call. Documented in [TokensUsage Wire Records](docs/under-the-hood/tokens-usage-wire-records.md).
+- **`TokensUsageRecord` — a deliberate client wire shape for token usage** (`pipelex/reporting/usage_records.py`). One flat record per inference call: `model_type`, `inference_model_name`, `inference_model_id`, `pipe_code`, `job_category`, `unit_job_id`, `nb_tokens_by_category` (raw provider counts), computed USD `cost` (`null` when the model has no rate table), and ISO `started_at`/`completed_at`. Enum-ish fields are open string sets on the wire, so runtime enum churn is non-breaking for clients. `compute_tokens_usage_cost` reuses the existing cost engine (`model_cost_per_token` + the cached/non-cached split), so the wire `cost` equals the CLI cost table's total for the same call. Documented in [TokensUsage Wire Records](under-the-hood/tokens-usage-wire-records.md).
### Changed
diff --git a/mkdocs.yml b/mkdocs.yml
index 2e6190376..3983dd0ea 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -549,6 +549,7 @@ nav:
- Codegen Projections: under-the-hood/codegen-projections.md
- Dry Run Mock Generation: under-the-hood/dry-run-mock-generation.md
- Execution Graph Tracing: under-the-hood/execution-graph-tracing.md
+ - TokensUsage Wire Records: under-the-hood/tokens-usage-wire-records.md
- Image Handling in LLM Prompts: under-the-hood/image-handling-in-llm-prompts.md
- Reasoning Controls: under-the-hood/reasoning-controls.md
- StuffArtefact & Image Rendering: under-the-hood/stuffartefact-and-image-rendering.md