> ## 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 Direct Query API (POST /query) with the Newton Fusion model (text, image, and video reasoning) or the Newton Omega encoder (time-series embeddings). ATAI_API_ENDPOINT must include the version path: /v0.5 for most APIs, /v0.6 for the Fine-Tuning Service. Pages whose descriptions are marked (Archived) document the legacy Lens runtime — do not use them for new projects.

# Get Agent

> Retrieve a single agent run and its current status

<Callout icon="clock" color="#3064E3" iconType="solid">
  Requires [version 1.1.9](/release-notes/1.1.x#v1-1-9) or later of the Archetype platform.
</Callout>

## Overview

This endpoint returns one agent (bundle run) by its `agt_` id, including its lifecycle status, I/O binding, and the executor job id once the run has been dispatched.

## Request

<ParamField path="agent_id" type="string" required>
  Agent `agt_` id.
</ParamField>

## Response

<ResponseField name="id" type="string" required>
  TypeID-encoded agent identifier (`agt_` prefix).
</ResponseField>

<ResponseField name="name" type="string" required>
  Name of the agent (a run's name is its bundle's name).
</ResponseField>

<ResponseField name="org_id" type="string" required>
  Organization identifier the agent belongs to.
</ResponseField>

<ResponseField name="bundle_id" type="string" required>
  The bundle this agent was run from (provenance).
</ResponseField>

<ResponseField name="blueprint" type="string" required>
  Human-readable pinned blueprint reference (its key), e.g. `osm`.
</ResponseField>

<ResponseField name="blueprint_id" type="string" required>
  Immutable blueprint id the bundle pinned.
</ResponseField>

<ResponseField name="status" type="string" required>
  Agent lifecycle status: `running`, `paused`, `completed`, `failed`, or `canceled`.
</ResponseField>

<ResponseField name="created_at" type="string" required>
  Creation timestamp (date-time).
</ResponseField>

<ResponseField name="connectors" type="object">
  Source/sink connectors binding this run's I/O; `null` when none is recorded.
</ResponseField>

<ResponseField name="connectors.source" type="array">
  One or more input refs; multiple files are staged on the same JOS input port.
</ResponseField>

<ResponseField name="connectors.sink" type="object">
  The single output ref, when the run was started with one. Omitted (the default): the runner writes one output per input, named after the input.
</ResponseField>

<ResponseField name="job_id" type="string">
  External executor's job id for the current run (a JOS `job_` id). Present once the run has been dispatched; lets clients query JOS for run progress.
</ResponseField>

<ResponseField name="started_at" type="string">
  When the run started; `null` before then.
</ResponseField>

<ResponseField name="completed_at" type="string">
  When the run finished; `null` while unfinished.
</ResponseField>

<ResponseField name="error" type="string">
  Failure detail; `null` unless the run failed.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl "$ATAI_API_URL/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f" \
    -H "Authorization: Bearer $ATAI_API_KEY"
  ```

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

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

  response = requests.get(
      f"{base_url}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f",
      headers={"Authorization": f"Bearer {api_key}"},
  )

  if response.status_code == 200:
      agent = response.json()
      print(f"{agent['name']} [{agent['status']}] job={agent.get('job_id')}")
      if agent.get("error"):
          print(f"Error detail: {agent['error']}")
  else:
      print(f"Error: {response.json()['errors']}")
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch(
    `${process.env.ATAI_API_URL}/agents/instances/agt_01jc9q8v5nm3ry7t2bkz4dhs6f`,
    {
      headers: {
        'Authorization': `Bearer ${process.env.ATAI_API_KEY}`
      }
    }
  );

  const body = await response.json();

  if (response.ok) {
    console.log(`${body.name} [${body.status}] job=${body.job_id}`);
  } else {
    console.error('Error:', body.errors);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={"system"}
  {
    "id": "agt_01jc9q8v5nm3ry7t2bkz4dhs6f",
    "name": "Pump A monitor",
    "org_id": "org_01jc8m5r2vq9xt4bn7h3kdzs6w",
    "bundle_id": "bnd_01jc9pd42kzq7v8n3h5m6rtx0w",
    "blueprint": "osm",
    "blueprint_id": "blp_01jc9n7k3xf8mbq2v5t0ary6de",
    "connectors": {
      "source": [
        {"type": "file", "id": "file_abc123", "format": "csv"}
      ],
      "sink": null
    },
    "status": "completed",
    "job_id": "job_01jc9q9k4t8v2mnr5xh7bdzy3s",
    "created_at": "2026-08-11T15:10:00Z",
    "started_at": "2026-08-11T15:10:04Z",
    "completed_at": "2026-08-11T15:18:41Z",
    "error": null
  }
  ```

  ```json 404 - Agent not found theme={"system"}
  {
    "errors": [
      {
        "code": "<error_code>",
        "message": "Agent not found.",
        "suggestion": null,
        "error_uid": "err-xxxxxxxx"
      }
    ]
  }
  ```
</ResponseExample>

## Important Notes

<Note>
  * Lifecycle: a run starts `running`, can move to `paused` and back via `/pause` and `/resume`, and terminates in `completed`, `failed`, or `canceled`.
  * `job_id` appears once the run has been dispatched to the executor; use it to query JOS for run progress.
  * To re-run, run the bundle again — each run is a new agent.
</Note>
