curl "$ATAI_API_ENDPOINT/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results?limit=50" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}"}
results_url = f"{base_url}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results"
cursor = None
while True:
params = {"limit": 100}
if cursor:
params["after"] = cursor
response = requests.get(results_url, headers=headers, params=params)
if response.status_code != 200:
print(f"Error: {response.json()['errors']}")
break
page = response.json()
for result in page["data"]:
file_ref = result["data"]
print(f"{result['port_name']}: {file_ref['filename']} -> {file_ref['ref']}")
if not page["has_more"]:
break
# The cursor is opaque — pass it back verbatim.
cursor = page["next_cursor"]
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results?limit=50`,
{
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const body = await response.json();
if (response.ok) {
body.data.forEach(result => {
console.log(`${result.port_name}: ${result.data.filename} -> ${result.data.ref}`);
});
} else {
console.error('Error:', body.errors);
}
{
"data": [
{
"id": "out_01jc9q9m6f",
"port_name": "predictions",
"data": {
"ref": "https://<presigned-url>",
"filename": "predictions.ndjson",
"file_extension": "ndjson",
"file_type": null,
"num_bytes": 48213,
"file_attributes": {
"job_output.status": "<status>"
}
},
"expires_at": "2026-08-12T15:18:41Z",
"created_at": "2026-08-11T15:18:41Z"
}
],
"has_more": false,
"next_cursor": null,
"prev_cursor": null
}
{
"data": [],
"has_more": false,
"next_cursor": null,
"prev_cursor": null
}
{
"errors": [
{
"code": "<error_code>",
"message": "Invalid cursor.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "Agent not found.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Instances
Get Agent Results
Page through the output artifacts an agent run produced
GET
/
agents
/
instances
/
{agent_id}
/
results
curl "$ATAI_API_ENDPOINT/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results?limit=50" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}"}
results_url = f"{base_url}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results"
cursor = None
while True:
params = {"limit": 100}
if cursor:
params["after"] = cursor
response = requests.get(results_url, headers=headers, params=params)
if response.status_code != 200:
print(f"Error: {response.json()['errors']}")
break
page = response.json()
for result in page["data"]:
file_ref = result["data"]
print(f"{result['port_name']}: {file_ref['filename']} -> {file_ref['ref']}")
if not page["has_more"]:
break
# The cursor is opaque — pass it back verbatim.
cursor = page["next_cursor"]
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results?limit=50`,
{
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const body = await response.json();
if (response.ok) {
body.data.forEach(result => {
console.log(`${result.port_name}: ${result.data.filename} -> ${result.data.ref}`);
});
} else {
console.error('Error:', body.errors);
}
{
"data": [
{
"id": "out_01jc9q9m6f",
"port_name": "predictions",
"data": {
"ref": "https://<presigned-url>",
"filename": "predictions.ndjson",
"file_extension": "ndjson",
"file_type": null,
"num_bytes": 48213,
"file_attributes": {
"job_output.status": "<status>"
}
},
"expires_at": "2026-08-12T15:18:41Z",
"created_at": "2026-08-11T15:18:41Z"
}
],
"has_more": false,
"next_cursor": null,
"prev_cursor": null
}
{
"data": [],
"has_more": false,
"next_cursor": null,
"prev_cursor": null
}
{
"errors": [
{
"code": "<error_code>",
"message": "Invalid cursor.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "Agent not found.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Requires version 1.1.9 or later of the Archetype platform.
Starting with version 2.0.1, this endpoint is removed from the platform. Use Get Session Results instead. To move existing code, see Migrating from Bundles and Instances.
Overview
This endpoint returns a page of a run’s output refs, newest first. Results come from the executor (JOS job outputs), so each entry names the output port it was written to and points at the stored file. The list is empty for a no-op run.Request
Forward cursor: return results older than this page. Pass the previous page’s
next_cursor. Opaque — not a result id; never compute on it. Mutually exclusive with before.Backward cursor: return results newer than this page. Opaque, as
after is. Mutually exclusive with after.Response
Cursor for the next page in the same direction — pass it as
after when paging forward, or as before when you supplied before. null when has_more is false.Cursor to step back the way this page was reached — pass it as
before after a forward page, or as after after a backward one. null when the request carried no cursor. v1.1.11+Result entry object
File ref object (data)
Fetchable reference to the bytes — a presigned URL, or a data-service ref that has to be downloaded through the authenticated proxy.
Executor-recorded attributes. Carries
job_output.status, which marks a result written by a run that only partially succeeded.curl "$ATAI_API_ENDPOINT/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results?limit=50" \
-H "Authorization: Bearer $ATAI_API_KEY"
import os
import requests
base_url = os.environ["ATAI_API_ENDPOINT"]
api_key = os.environ["ATAI_API_KEY"]
headers = {"Authorization": f"Bearer {api_key}"}
results_url = f"{base_url}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results"
cursor = None
while True:
params = {"limit": 100}
if cursor:
params["after"] = cursor
response = requests.get(results_url, headers=headers, params=params)
if response.status_code != 200:
print(f"Error: {response.json()['errors']}")
break
page = response.json()
for result in page["data"]:
file_ref = result["data"]
print(f"{result['port_name']}: {file_ref['filename']} -> {file_ref['ref']}")
if not page["has_more"]:
break
# The cursor is opaque — pass it back verbatim.
cursor = page["next_cursor"]
const response = await fetch(
`${process.env.ATAI_API_ENDPOINT}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f/results?limit=50`,
{
headers: {
'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
}
}
);
const body = await response.json();
if (response.ok) {
body.data.forEach(result => {
console.log(`${result.port_name}: ${result.data.filename} -> ${result.data.ref}`);
});
} else {
console.error('Error:', body.errors);
}
{
"data": [
{
"id": "out_01jc9q9m6f",
"port_name": "predictions",
"data": {
"ref": "https://<presigned-url>",
"filename": "predictions.ndjson",
"file_extension": "ndjson",
"file_type": null,
"num_bytes": 48213,
"file_attributes": {
"job_output.status": "<status>"
}
},
"expires_at": "2026-08-12T15:18:41Z",
"created_at": "2026-08-11T15:18:41Z"
}
],
"has_more": false,
"next_cursor": null,
"prev_cursor": null
}
{
"data": [],
"has_more": false,
"next_cursor": null,
"prev_cursor": null
}
{
"errors": [
{
"code": "<error_code>",
"message": "Invalid cursor.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
{
"errors": [
{
"code": "<error_code>",
"message": "Agent not found.",
"suggestion": null,
"error_uid": "err-xxxxxxxx"
}
]
}
Important Notes
- The cursor here is opaque and is not a result ID. Pass
next_cursorback verbatim; never derive it fromdata[last].id. refmay be a presigned URL or a data-service ref — the latter must be downloaded through the authenticated proxy.- Check
file_attributes["job_output.status"]: it marks a result written by a run that only partially succeeded. - A no-op run produces no outputs, so
datacomes back empty.
Was this page helpful?