auto router

Get Auto Router Session

One auto-routed session, for the key that ran it: the model its last turn was routed to and the session's spend against the router's savings baseline. Built for a coding agent's status line or stop hook, so any virtual key may call it and only ever sees rows written under its own key hash. Reads the LiteLLM_AutoRouterSession rollup, which the asynchronous spend flush fills a moment after each turn; a session with no flushed auto-routed turn yet is a 404. The id is bounded the way the writer bounded it, so an oversized client id still finds its row.

get/auto_router/session

Request

  • Base URL: https://apiclaw.biz (the document declares no server; this is the origin it was published from)
  • URL: https://apiclaw.biz/auto_router/session
  • Auth: API key in header x-litellm-api-key

Query parameters

session_idstring required

The client session id (x-*-session-id header) the turns were sent under

Response

Successful Response

session_idstring required
router_namestring required

The auto-router alias the session's requests were sent to

router_typestring required

complexity, adaptive or quality

turnsinteger required

Auto-routed turns the rollup has recorded for this session so far

last_modelstring required

The deployment model the most recent turn was routed to

spendnumber required

What the session's routed traffic actually cost, classifier calls included

savings_estimated_turnsinteger required

Requests whose savings estimate recorded its baseline cost

savings_estimated_actual_spendnumber required

Actual spend, including classifier cost, for requests whose estimate recorded its baseline cost

saved_spendnumber nullable required

Recorded historical savings plus newer estimates, net of classifier cost

baseline_spendnumber nullable required

Estimated single-model cost: spend plus recorded savings

savings_estimated_baseline_spendnumber nullable required

Estimated single-model cost for requests whose estimate recorded its baseline cost

baseline_modelstring nullable required

The savings baseline recorded by most session turns, including historical turns, recorded turn by turn, so it still names the counterfactual after the router is reconfigured or removed. None when no turn recorded one: rows from before the baseline was recorded, and adaptive and quality routers, which derive no baseline and so report no savings

baseline_modelsobject required

Session turns recording each baseline model; more than one entry means the router's baseline changed mid-session; these counts do not imply savings coverage

Changes

No recorded changes to this operation across all 1 revision of this API.