curl "$ATAI_API_ENDPOINT/inference/sessions/ses_01jcx4m8t2vq6xn3r7k5hbzw9e" \
-H "Authorization: Bearer $ATAI_API_KEY"
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']}")
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);
}
{
"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"
}
{
"errors": [
{
"code": "not_found",
"message": "Session 'ses_01jcx4m8t2vq6xn3r7k5hbzw9e' not found",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Sessions
Get Model Session
Get one of your sessions on a platform-hosted model by ID
GET
/
api
/
inference
/
sessions
/
{session_id}
curl "$ATAI_API_ENDPOINT/inference/sessions/ses_01jcx4m8t2vq6xn3r7k5hbzw9e" \
-H "Authorization: Bearer $ATAI_API_KEY"
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']}")
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);
}
{
"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"
}
{
"errors": [
{
"code": "not_found",
"message": "Session 'ses_01jcx4m8t2vq6xn3r7k5hbzw9e' not found",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Requires version 2.0.1 or later of the Archetype platform.
Overview
This endpoint returns one of your sessions on a model by itsses_ ID. A session you can’t see
returns 404, the same as one that doesn’t exist.
Request
Response
Where the session is in its lifecycle:
running: open and able to answer queries. A session isrunningfrom the moment it opens.completed: ended without a fault, for example because it sat idle long enough to expire.errorsays why.failed: ended by a fault, usually because the copy of the model holding it was lost during a release.errorsays why.cancelled: ended by your cancel, or because the copy of the model holding it was replaced. In the second case,errorsays so.
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.curl "$ATAI_API_ENDPOINT/inference/sessions/ses_01jcx4m8t2vq6xn3r7k5hbzw9e" \
-H "Authorization: Bearer $ATAI_API_KEY"
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']}")
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);
}
{
"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"
}
{
"errors": [
{
"code": "not_found",
"message": "Session 'ses_01jcx4m8t2vq6xn3r7k5hbzw9e' not found",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Important Notes
404means 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.
Was this page helpful?