analyze_session_usage
Analyze one specific session's actual recorded LLM usage (tagged via record_usage's session_id) on demand: total input/output tokens, total actual cost, and a per-model breakdown if more than one model was used. Also runs the session's own observed token pattern through the same routing engine behind recommend_model / POST /router/recommend to produce a grounded recommendation — or confirm the current choice is already optimal — with the estimated dollar savings or increase versus this session's actual cost. Returns has_data: false with no recommendation if the session_id has no recorded usage. Advisory only — never switches or reroutes anything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org_id | No | Optional organisation ID filter — scopes the lookup to usage events recorded under that org_id, same as get_usage_summary's org_id | |
| session_id | Yes | The session_id previously used when calling record_usage |