> ## 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.

> ## Agent Instructions
> H Platform has four products: the Agents API (managed computer-use agents, base URL https://agp.eu.hcompany.ai/api/v2 or https://agp.hcompany.ai/api/v2 for the US), the Models API (OpenAI-compatible Holo vision-language models at https://api.hcompany.ai/v1), HoloDesktop CLI (Holo on the user's own desktop), and HoloTab (a free no-code Chrome extension that runs Holo in the user's browser, with recordable routines and schedules).
> Authenticate with a bearer API key from the HAI_API_KEY environment variable. SDKs: `pip install hai-agents` (Python, `from hai_agents import Client`) and `npm install hai-agents` (TypeScript, `import { HaiAgentsClient } from "hai-agents"`). CLI: `hai`.
> Agents do work in a browser or on a desktop; describe the task as an imperative instruction. To run a task quickly, prefer the pre-built agent `h/web-surfer-flash`. Read results from the session's `latest_answer` after it reaches a terminal status.
> Sessions are the unit of work; wait for a terminal status (completed, failed, timed_out, interrupted) before reading the answer. Use webhooks or the `changes` long-poll endpoint to follow progress.

# Get session status

> Lightweight polling endpoint: current state, step count, and token usage of a session.

Returns only a session's live status: state, step count, token usage, and subagent IDs. It is the cheapest liveness check, and it never carries the answer. To follow a run and read its `answer`, long-poll [`changes`](/agents-api/sessions/changes) instead.

**Returns** the status object [below](#response).

## Path parameters

<ParamField path="id" type="string" required>
  The session ID.
</ParamField>

## Response

<ResponseField name="status" type="string" required>
  Current state: `queued`, `pending`, `running`, `paused`, `idle`, `awaiting_tool_results`, `completed`, `failed`, `timed_out`, or `interrupted`. See [Lifecycle](/agents-api/sessions/overview#lifecycle).
</ResponseField>

<ResponseField name="error" type="string | null">
  Short, stable error message if the session failed or timed out. Branch on `error_code`, not on this text.
</ResponseField>

<ResponseField name="error_code" type="string | null">
  Machine-readable failure category if the session failed or timed out: `environment_error`, `no_answer`, `answer_validation`, `timeout`, `insufficient_credit`, or `internal`. See [Session failures](/agents-api/errors#session-failures).
</ResponseField>

<ResponseField name="outcome" type="string | null">
  The agent's self-assessed outcome, reported with its final answer: `success`, `partial`, `infeasible`, or `blocked`. `null` until reported. See [Outcomes](/agents-api/errors#outcomes).
</ResponseField>

<ResponseField name="steps" type="integer">
  Steps taken so far, where each step is one decide-and-act cycle.
</ResponseField>

<ResponseField name="usage_per_model" type="object[]">
  Per-model token usage: `name`, `input_tokens`, `cached_tokens` (input served from the prompt cache, billed at a discount), `output_tokens`, and `reasoning_tokens`. Empty until the agent calls a model.
</ResponseField>

<ResponseField name="subagent_session_ids" type="string[]">
  IDs of the child sessions this session spawned. List them with their `agent` labels via [`GET /sessions?parent_session_id={id}`](/agents-api/sessions/list#find-the-subagents-a-session-spawned).
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={"system"}
  curl https://agp.eu.hcompany.ai/api/v2/sessions/$SESSION_ID/status \
    -H "Authorization: Bearer $HAI_API_KEY"
  ```

  ```python Python theme={"system"}
  from hai_agents import Client

  client = Client()

  status = client.sessions.get_session_status(session_id)
  print(status.status, status.steps)
  ```

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

  const client = new HaiAgentsClient();

  const status = await client.sessions.getSessionStatus({ id: sessionId });
  console.log(status.status, status.steps);
  ```
</CodeGroup>

```json Response theme={"system"}
{
  "status": "running",
  "error": null,
  "error_code": null,
  "outcome": null,
  "steps": 7,
  "usage_per_model": [
    {
      "name": "holo4-27b",
      "input_tokens": 12400,
      "cached_tokens": 9800,
      "output_tokens": 890,
      "reasoning_tokens": 0
    }
  ],
  "subagent_session_ids": []
}
```

## Polling

Poll every 2 to 5 seconds, backing off to 10 to 15 seconds for runs over 10 minutes. Once the status is terminal, read the answer from [`latest_answer`](/agents-api/sessions/retrieve#response).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.