Feature
Map gateway-reported cost, token usage, and tokens-per-second into the host harness so a run shows real $ and tok/s, not catalog guesses.
Why
OmniRoute already emits (non-stream) X-OmniRoute-Response-Cost, X-OmniRoute-Tokens-In/Out, X-OmniRoute-Latency-Ms, X-OmniRoute-Model, X-OmniRoute-Provider, X-OmniRoute-Decision. CLIProxyAPI often has upstream usage and, on some builds, internal TPS — but plugins typically register models and stop there.
Harness cost UIs (OpenCode session cost, Pi usage, OMP status) therefore:
- price the requested model from models.dev /
/api/pricing even after a combo/credential failover
- omit tok/s, or compute it client-side from deltas (wrong on buffered streams and tool pauses)
Live generation speed cannot come from models.dev. It has to ride on the completion.
Requested behavior
- On each completion (stream final chunk included), read gateway usage/cost/tok/s headers or
usage fields and write them into the host’s usage/cost/speed slots.
- If the gateway updates the routed model mid-request (combo / credential failover), update the host’s displayed model id for that turn.
- Prefer gateway numbers over catalog
cost × token estimates when both exist.
- If the gateway has no tok/s yet, do not invent one from
tokens / latency_ms (that includes TTFT). Show — until the gateway field exists.
- Keep catalog sync (models.dev /
/v1/models / /api/pricing) for picker metadata; this issue is per-request telemetry.
Related gateway asks (please link rather than re-implement scraping):
- OmniRoute: tok/s + streaming cost headers
- CLIProxyAPI: tok/s / usage on the inference response
Acceptance
- One streamed turn shows host cost + tok/s that match the gateway response.
- After failover, the turn is attributed to the model that answered.
- No extra HTTP calls to dashboards or log APIs.
Feature
Map gateway-reported cost, token usage, and tokens-per-second into the host harness so a run shows real
$andtok/s, not catalog guesses.Why
OmniRoute already emits (non-stream)
X-OmniRoute-Response-Cost,X-OmniRoute-Tokens-In/Out,X-OmniRoute-Latency-Ms,X-OmniRoute-Model,X-OmniRoute-Provider,X-OmniRoute-Decision. CLIProxyAPI often has upstreamusageand, on some builds, internal TPS — but plugins typically register models and stop there.Harness cost UIs (OpenCode session cost, Pi usage, OMP status) therefore:
/api/pricingeven after a combo/credential failoverLive generation speed cannot come from models.dev. It has to ride on the completion.
Requested behavior
usagefields and write them into the host’s usage/cost/speed slots.cost× token estimates when both exist.tokens / latency_ms(that includes TTFT). Show—until the gateway field exists./v1/models//api/pricing) for picker metadata; this issue is per-request telemetry.Related gateway asks (please link rather than re-implement scraping):
Acceptance