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

> ## Agent Instructions
> Start with /introduction/getting-started. Use the Inference API's Direct Query endpoint (POST /api/inference/query) with the newton-c-2.6 or newton-fusion-1.0 model (text, image, and video reasoning) or the omega-embedding encoder (time-series embeddings). ATAI_API_ENDPOINT is the base URL https://platform.u1.archetypeai.app with no version path; every endpoint path begins with /api. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# Get Model Session

> Get one of your sessions on a platform-hosted model by ID

Requires [version 2.0.1](https://docs.archetypeai.app/release-notes/2.0.x.md#v2-0-1) or later of the Archetype platform.

## Overview

This endpoint returns one of your sessions on a model by its `ses_` ID. A session you can't see
returns `404`, the same as one that doesn't exist.

## Request

**session\_id** `string` *required*

Session `ses_` ID.

## Response

**id** `string`

The session's `ses_` ID.

**model** `string`

The name of the model the session is on, whichever of the model's names opened it.

**status** `string`

Where the session is in its lifecycle:

* `running`: open and able to answer queries. A session is `running` from the moment it opens.
* `completed`: ended without a fault, for example because it sat idle long enough to expire.
  `error` says why.
* `failed`: ended by a fault, usually because the copy of the model holding it was lost during a
  release. `error` says why.
* `cancelled`: ended by your cancel, or because the copy of the model holding it was replaced. In
  the second case, `error` says so.

**values** `object | null`

The values the session was opened with, or `null` for none.

**error** `string | null`

Why the platform ended the session, for example `the session's replica was replaced`. `null` while
the session runs or when you cancelled it. Don't parse it: open a new session when a call returns
`409` with code `session_not_running`.

**created\_at** `string`

When the session was created (ISO 8601).

**started\_at** `string | null`

When the session started running (ISO 8601), or `null` until then.

**completed\_at** `string | null`

When the session ended (ISO 8601), or `null` while it runs.

```bash cURL theme={"system"}
curl "$ATAI_API_ENDPOINT/inference/sessions/ses_01jcx4m8t2vq6xn3r7k5hbzw9e" \
  -H "Authorization: Bearer $ATAI_API_KEY"
```

```python Python theme={"system"}
import os
import requests

base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]

response = requests.get(
    f"{base_url}/inference/sessions/ses_01jcx4m8t2vq6xn3r7k5hbzw9e",
    headers={"Authorization": f"Bearer {api_key}"},
)

if response.ok:
    print(response.json()["status"])
else:
    print(f"Error: {response.json()['errors']}")
```

```javascript JavaScript theme={"system"}
const response = await fetch(
  `${process.env.ATAI_API_ENDPOINT}/inference/sessions/ses_01jcx4m8t2vq6xn3r7k5hbzw9e`,
  {
    headers: {
      'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
    }
  }
);

const body = await response.json();
if (response.ok) {
  console.log(body.status);
} else {
  console.error('Error:', body.errors);
}
```

```json 200 - Session ended because its copy of the model was replaced theme={"system"}
{
  "id": "ses_01jcx4m8t2vq6xn3r7k5hbzw9e",
  "model": "omega-embedding",
  "status": "cancelled",
  "values": {"window_size": 1024, "step_size": 512},
  "error": "the session's replica was replaced",
  "created_at": "2026-11-11T09:12:44Z",
  "started_at": "2026-11-11T09:12:51Z",
  "completed_at": "2026-11-11T10:02:17Z"
}
```

```json 404 - Session not found theme={"system"}
{
  "errors": [
    {
      "code": "not_found",
      "message": "Session 'ses_01jcx4m8t2vq6xn3r7k5hbzw9e' not found",
      "suggestion": null,
      "error_uid": "err-xxxxxxxx"
    }
  ]
}
```

## Important Notes

> [!NOTE]
>
> * `404` means the session doesn't exist or isn't visible to you.
> * You see your own sessions. A service-account key sees the sessions of every service-account key in
>   the organization, and an organization admin sees all of the organization's.


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