List agent sessions
GET/agents/sessions
Lists managed agent sessions using ID-based pagination and the requested sort order. See managing sessions.
Query Parameters
after: optional string
Return resources after this resource ID in the selected order.
minLength0
maxLength1048576
agent_id: optional string
Only return sessions whose root agent has this ID. Omit to return sessions for all agents.
minLength0
maxLength1048576
List agent sessions
curl https://api.openai.com/v1/agents/sessions \
-H 'OpenAI-Beta: agents=v1' \
-H "Authorization: Bearer $OPENAI_API_KEY"{
"data": [
{
"id": "id",
"agent": {
"id": "id",
"instructions": "instructions",
"model": "model",
"multi_agent": {
"enabled": true,
"max_concurrent_subagents": 1
},
"name": "name",
"reasoning": {
"effort": "none",
"summary": "concise"
},
"service_tier": "auto",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"tools": [
{
"defer_loading": true,
"description": "description",
"name": "name",
"parameters": {
"foo": "bar"
},
"type": "function"
}
]
},
"created_at": 0,
"environment": {
"type": "none"
},
"error": "error",
"last_active_at": 0,
"metadata": {
"foo": "string"
},
"object": "agent.session",
"required_actions": [
{
"request": {
"credential_origin": "credential_origin",
"fields": [
{
"id": "id",
"label": "label",
"required": true,
"type": "type"
}
],
"options": [
{
"id": "id",
"field_ids": [
"string"
],
"label": "label"
}
],
"reason": "reason",
"type": "browser_authentication"
},
"request_id": "request_id",
"turn_id": "turn_id",
"type": "computer_use_approval_request"
}
],
"status": "idle",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"vault_ids": [
"string"
],
"spend_control": {
"consumed": 0,
"limit": 1
}
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}Returns Examples
{
"data": [
{
"id": "id",
"agent": {
"id": "id",
"instructions": "instructions",
"model": "model",
"multi_agent": {
"enabled": true,
"max_concurrent_subagents": 1
},
"name": "name",
"reasoning": {
"effort": "none",
"summary": "concise"
},
"service_tier": "auto",
"text": {
"format": {
"type": "text"
},
"verbosity": "low"
},
"tools": [
{
"defer_loading": true,
"description": "description",
"name": "name",
"parameters": {
"foo": "bar"
},
"type": "function"
}
]
},
"created_at": 0,
"environment": {
"type": "none"
},
"error": "error",
"last_active_at": 0,
"metadata": {
"foo": "string"
},
"object": "agent.session",
"required_actions": [
{
"request": {
"credential_origin": "credential_origin",
"fields": [
{
"id": "id",
"label": "label",
"required": true,
"type": "type"
}
],
"options": [
{
"id": "id",
"field_ids": [
"string"
],
"label": "label"
}
],
"reason": "reason",
"type": "browser_authentication"
},
"request_id": "request_id",
"turn_id": "turn_id",
"type": "computer_use_approval_request"
}
],
"status": "idle",
"usage": {
"input_tokens": 0,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 0,
"output_tokens_details": {
"reasoning_tokens": 0
},
"total_tokens": 0
},
"vault_ids": [
"string"
],
"spend_control": {
"consumed": 0,
"limit": 1
}
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id",
"object": "list"
}