Get Session
GET
/v1/sessions/{session_id}Retrieve the full details of a session including its current status and usage.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id | string | ✅ | The session ID (sess_...) |
Request Examples
python
from anthropic import Anthropic
client = Anthropic(
api_key="sk-sb-YOUR_KEY",
base_url="https://api.sandbase.ai"
)
session = client.beta.sessions.retrieve(
session_id="sess_01abc..."
)
print(f"Status: {session.status}")typescript
const session = await client.beta.sessions.retrieve('sess_01abc...');
console.log(`Status: ${session.status}`);bash
curl https://api.sandbase.ai/v1/sessions/sess_01abc... \
-H "Authorization: Bearer sk-sb-YOUR_KEY"Response
Returns a Session object.
json
{
"id": "sess_01abc...",
"type": "session",
"status": "idle",
"title": "Research task",
"agent_id": "agent_01HqR2k7...",
"agent_version": 1,
"environment_id": "env_01abc...",
"usage": {
"input_tokens": 12500,
"output_tokens": 4200
},
"metadata": { "user_id": "usr_123", "task": "research" },
"archived_at": null,
"created_at": "2026-05-29T10:00:00Z",
"updated_at": "2026-05-29T10:05:00Z"
}Errors
| Status | Type | Description |
|---|---|---|
| 401 | authentication_error | Invalid or missing API key |
| 404 | not_found | Session not found |

