From ef9bfa6f6824ddb24e91a04a79a907b5e2a6c010 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Thu, 7 May 2026 12:01:09 -0700 Subject: [PATCH] feat(v2 managed agents): add AgentList and SessionList typed models Used by the new GET /v2/agents and GET /v2/agents/:agent_id/sessions listing endpoints. Each list response carries data + next_cursor + has_more for simple offset-based pagination. --- litellm/managed_agents/types.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/litellm/managed_agents/types.py b/litellm/managed_agents/types.py index 10e260f13e5..1ac5c5f4570 100644 --- a/litellm/managed_agents/types.py +++ b/litellm/managed_agents/types.py @@ -63,6 +63,19 @@ class AgentRow(BaseModel): updated_at: datetime +class AgentList(BaseModel): + """Paginated list response for `GET /v2/agents`. + + `config.litellm_api_key` is masked on each row in `data`. + """ + + model_config = ConfigDict(extra="allow") + + data: List[AgentRow] + next_cursor: Optional[str] = None + has_more: bool = False + + # --------------------------------------------------------------------------- # Sandbox / session # --------------------------------------------------------------------------- @@ -137,6 +150,16 @@ class SessionRow(BaseModel): terminated_at: Optional[datetime] = None +class SessionList(BaseModel): + """Paginated list response for `GET /v2/agents/:id/sessions`.""" + + model_config = ConfigDict(extra="allow") + + data: List[SessionRow] + next_cursor: Optional[str] = None + has_more: bool = False + + # --------------------------------------------------------------------------- # Message # ---------------------------------------------------------------------------