Skip to content

docs: document pricing diagnostics, metrics endpoint, and DiffOutcome per-1k token fields#33

Merged
Gsbreddy merged 1 commit into
mainfrom
cursor/documentation-automation-system-707f
May 2, 2026
Merged

docs: document pricing diagnostics, metrics endpoint, and DiffOutcome per-1k token fields#33
Gsbreddy merged 1 commit into
mainfrom
cursor/documentation-automation-system-707f

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 2, 2026

Summary

Closes documentation gaps introduced by v1.0.4 (metrics endpoint + pricing diagnostics) that were not fully reflected in the reference docs.

Docs added/updated

docs/operations-and-policy.md

  • Expanded the Pricing and model change detection section to cover the six new DiffOutcome per-1k token rate fields added in v1.0.4 (baseline_input_usd_per_1k_tokens, baseline_output_usd_per_1k_tokens, baseline_cached_input_usd_per_1k_tokens, and their candidate counterparts).
  • Documents the CLI Per-1k token prices output line (conditionally printed when all four input/output rates are present).
  • Documents the pricing.prices object in the POST /v1/diff HTTP response (always present; fields null when rate not set in the table).
  • Cross-references the web UI banner behaviour and links to web-ui.md.

docs/sdk.md

  • Added a GET /v1/metrics (no SDK wrapper) subsection explaining that the endpoint has no dedicated method in FlightdeckClient/AsyncFlightdeckClient, with a copy-pasteable httpx example and a link to the HTTP API reference.

docs/web-ui.md

  • Updated the DiffPage pricing change warning bullet to mention the new per-1k input/output price delta line shown in the fd-alert--warn banner (rendered when all four rates are non-null; toFixed(6) formatting).

Codepaths covered

  • src/flightdeck/operations.pyDiffOutcome per-1k rate fields
  • src/flightdeck/server/routes/actions.pypricing.prices in POST /v1/diff response
  • src/flightdeck/server/routes/metrics.pyGET /v1/metrics
  • src/flightdeck/storage.pyget_ledger_counters()
  • src/flightdeck/cli/main.py — Per-1k token prices CLI output
  • web/src/pages/DiffPage.tsxpickPrices() and banner rendering

Key knowledge gaps addressed

  • DiffOutcome carries six per-1k token rate fields since v1.0.4 — these were undocumented outside the source code and CHANGELOG.md.
  • GET /v1/metrics had no guidance on how to consume it from Python (no SDK wrapper exists).
  • The web UI's pricing banner now shows token price deltas, but web-ui.md only described the provider/version/model display from v1.0.3.

Verification

  • uv run python -m ruff check src tests — clean
  • uv run python -m pytest — 94 passed
Open in Web View Automation 

… per-1k token fields

- operations-and-policy.md: expand the pricing/model change detection section to document
  the six new DiffOutcome per-1k token rate fields, the CLI 'Per-1k token prices' output
  line (condition: all four input/output rates present), the pricing.prices HTTP response
  object (always present, null for unset rates), and the web UI banner behaviour.

- sdk.md: add a 'GET /v1/metrics (no SDK wrapper)' subsection showing how to call the
  endpoint directly via httpx, with example response and a link to the HTTP API reference.

- web-ui.md: update the DiffPage pricing change warning bullet to mention the new per-1k
  input/output price delta line in the fd-alert--warn banner (rendered when all four rates
  are present; toFixed(6) formatting).

Co-authored-by: Gottam Sai Bharath <Gsbreddy@users.noreply.github.com>
@Gsbreddy Gsbreddy marked this pull request as ready for review May 2, 2026 18:14
@Gsbreddy Gsbreddy merged commit 86d32bf into main May 2, 2026
2 checks passed
@Gsbreddy Gsbreddy deleted the cursor/documentation-automation-system-707f branch May 2, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants