Skip to main content

Sessions

Sessions represent individual agent interactions with a sandbox.

List Sessions

curl https://api.caged.dev/v1/sandboxes/cage-a1b2c3d4/sessions \
  -H "Authorization: Bearer caged_sk_..."
Response 200 OK
[
  {
    "id": "sess-a1b2c3d4",
    "sandbox_id": "cage-a1b2c3d4",
    "status": "completed",
    "agent_type": "claude-code",
    "model": "claude-sonnet-4-20250514",
    "tokens_in": 15420,
    "tokens_out": 8230,
    "cost_usd": 0.0847,
    "trust_score": 92,
    "duration_ms": 45200,
    "started_at": "2026-06-08T10:00:00Z",
    "ended_at": "2026-06-08T10:00:45Z"
  }
]

Session Fields

FieldTypeDescription
idstringUnique session ID
sandbox_idstringAssociated sandbox
statusstringactive, completed, error
agent_typestringAgent identifier
modelstringLLM model used
tokens_inintegerTotal input tokens
tokens_outintegerTotal output tokens
cost_usdnumberTotal cost (LLM + compute)
trust_scoreintegerBehavioral trust score (0-100)
duration_msintegerSession duration in milliseconds
started_atstringISO 8601 start time
ended_atstringISO 8601 end time