Documentation/Model monitoring

Model monitoring

Monitoring groups usage by provider connection and actual upstream model. Public aliases of the same upstream model on one connection are aggregated. Provider identity uses the credential connection name when available; inline addresses remove authentication and query parameters. Selectors list currently enabled, authorized deployments and do not add revoked or disabled historical combinations.

The catalog returned in options follows the current caller’s effective grants: a virtual key uses its organization/team/project/key intersection; a session without team_id reads the account’s current team and organization. An explicit team is checked by UsageScope before its model grants are read. Platform administrators can see all currently enabled deployments. Authorization lookup failures reject the request rather than falling back to an unrestricted catalog. Ordinary users’ statistics require the requested alias to remain authorized and the recorded supplier and upstream model to match a currently authorized deployment. Routing groups and fallbacks also check source grants; cross-alias matches are conservatively excluded if a disabled or unauthorized deployment shares the identity. Older events lack an actual member identifier, so even a direct alias and upstream match does not prove which specific deployment executed it. Revocation does not erase billing history; complete historical costs remain available in Usage or Logs.

Billing and monitoring buckets commit in the same PostgreSQL transaction. Statistics change only after an idempotent billing insert succeeds. Task settlement subtracts the previous value and adds the settled value. Queued billing becomes visible after persistence.

Fifteen-minute UTC buckets retain organization, team, project, user, key, billing ownership, provider and upstream-model dimensions. Batches merge matching buckets and apply UPSERTs in stable key order. Platform administrators query the existing aggregated buckets; ordinary users query usage_events to check current grants. Purged or ambiguous events are omitted, and a query exceeding 15 seconds returns an error. Both paths use a window of 1–90 days and timezone offsets aligned to 15 minutes. High-volume users and teams can increase raw-event query cost; local tests are not a production load benchmark.

TTFT records the first upstream response byte/data segment, which can contain metadata rather than visible text. TPS uses output tokens × 1000 / (total milliseconds − first-byte milliseconds), and only successful uncached streamed text with positive output and a valid interval contributes a sample. Input tokens never inflate generation speed; synchronous responses have no TPS sample because their response-read tail cannot represent model generation. Cross-bucket means are weighted by valid sample counts. Request, token and cost totals continue to include all recorded terminal requests.

Startup upgrades rebuild output TPS once from retained usage events in a transaction shared with billing writes. New output-TPS columns keep the corrected metric separate from legacy writers. Only performance sums/sample counts are rebuilt; historical billing, request counts, tokens and other measurements are retained. Buckets whose original events have been purged keep their totals but show no TPS sample. A completion marker makes repeated startup idempotent; a failed rebuild rolls back and fails startup.

The bilingual Recharts interface displays at most eight chart series while retaining all combinations in the detail table. Deploy matching console, gateway and database structures. Missing interface structures produce a retryable error.

Request log amounts and reasoning effort

Log tables, session views, metrics and cost breakdowns share a USD formatter that preserves the numeric precision supplied by the API. Small nonzero costs do not round to $0.00; real zero remains $0.00, and missing values remain unknown. This only changes presentation, not pricing or billing.

The log reasoning_effort field records an explicitly requested Chat reasoning_effort, Responses reasoning.effort, or Messages output_config.effort. It is persisted independently of prompt storage. Missing settings and pre-upgrade records remain unknown; model defaults, thinking budgets and actual provider behavior are not inferred. Startup adds the column idempotently without replaying bills.

Search full documentation: budgets, routing, Docker…