> ## Documentation Index
> Fetch the complete documentation index at: https://hub.hcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a session

> Get full details of a single session.

Retrieves the complete [Session](/computer-use-agents/sessions/overview) object, including the original request, current status, execution metadata, and `latest_answer` (the agent's final answer once produced). This is the cursor-independent way to read a finished run's result, with no event loop to drain.

Auth is optional, so public shares are supported.

**Returns** the [Session](/computer-use-agents/sessions/overview) object if the ID is valid and you have access. Returns `404` otherwise.

***

## Path parameters

<ParamField path="id" type="string" required>
  The session ID returned when the session was created.
</ParamField>

***

## Examples

<CodeGroup>
  ```bash CLI theme={null}
  hai sessions get a1b2c3d4-e5f6-7890-abcd-ef1234567890
  ```

  ```bash cURL theme={null}
  curl https://agp.eu.hcompany.ai/api/v2/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  session = client.sessions.get_session("a1b2c3d4-e5f6-7890-abcd-ef1234567890")
  print(session.status.status, session.latest_answer)
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  const session = await client.sessions.getSession({
    id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  });
  console.log(session.status.status, session.latestAnswer);
  ```
</CodeGroup>

```json Response theme={null}
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "request": {
    "agent": "h/web-surfer-flash",
    "messages": [
      {"type": "user_message", "message": "Find the top 3 stories on Hacker News"}
    ]
  },
  "status": {
    "status": "completed",
    "error": null,
    "steps": 12,
    "usage_per_model": [
      {
        "name": "holo3-1-35b-a3b",
        "input_tokens": 24800,
        "output_tokens": 1420,
        "reasoning_tokens": 0
      }
    ],
    "subagent_session_ids": []
  },
  "agent_view_url": "https://platform.hcompany.ai/agents/sessions/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "latest_answer": "1. ... 2. ... 3. ...",
  "created_at": "2026-05-07T14:30:00Z",
  "started_at": "2026-05-07T14:30:02Z",
  "finished_at": "2026-05-07T14:31:15Z"
}
```

***

## Errors

| Status | Cause                                              |
| ------ | -------------------------------------------------- |
| `404`  | Session not found, or you don't have access to it. |

If you only need to know whether the session has finished, poll the lighter, faster [`GET /sessions/{id}/status`](/computer-use-agents/sessions/status) instead.
