ultrarouter docs
API reference

Generation

Post-hoc per-request stats (OpenRouter parity).

Post-hoc per-request stats (OpenRouter parity).

This page is GENERATED from the OpenAPI spec (openapi.yaml) — it can never drift from the served API. Set UR_BASE_URL (required: your gateway’s URL) and UR_API_KEY (an ur_sk_* key); secrets are always the $UR_API_KEY placeholder.

Get post-hoc stats for one request

GET /v1/generation

OpenRouter /generation parity — cost/tokens/timing/routing for one prior request. Requires API-key scope: gateway:invoke.

Auth: API key (Authorization: Bearer ur_sk_…).

curl -sS -X GET "$UR_BASE_URL/v1/generation" \
  -H "Authorization: Bearer $UR_API_KEY"