Skip to main content
GET
/
agent
/
runs
/
{id}
cURL
curl -s "https://api.exa.ai/agent/runs/agent_run_01j..." \
  -H "x-api-key: $EXA_API_KEY"
from exa_py import Exa

exa = Exa(api_key="YOUR_EXA_API_KEY")
run_id = "agent_run_01j..."
run = exa.agent.runs.get(
run_id,
)
print(run)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.exa.ai/agent/runs/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
{
  "id": "agent_run_01j7x9v0m2n4p6q8r0s2t4v6w8",
  "object": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "completedAt": "2023-11-07T05:31:56Z",
  "request": {
    "query": "What are the most important AI infrastructure funding rounds announced this week?",
    "systemPrompt": "Prefer official sources and avoid duplicate results.",
    "input": {
      "data": [
        {}
      ],
      "exclusion": [
        {}
      ]
    },
    "outputSchema": {},
    "effort": "auto",
    "previousRunId": "agent_run_01j7x9v0m2n4p6q8r0s2t4v6w8",
    "metadata": {
      "slack_channel_id": "C123ABC",
      "slack_thread_id": "1745444400.123456",
      "user_id": "U123ABC"
    },
    "dataSources": [
      {
        "provider": "fiber"
      }
    ]
  },
  "output": {
    "text": "<string>",
    "structured": true,
    "grounding": [
      {
        "field": "structured.companies[0].sourceUrl",
        "citations": [
          {
            "url": "<string>",
            "title": "<string>"
          }
        ]
      }
    ]
  },
  "usage": {
    "agentComputeUnits": 1,
    "searches": 1,
    "emails": 1,
    "phoneNumbers": 1,
    "dataSources": {}
  },
  "costDollars": {
    "total": 1,
    "agentCompute": 1,
    "search": 1,
    "emails": 1,
    "phoneNumbers": 1,
    "dataSources": {}
  }
}
{
"error": {
"message": "<string>"
}
}
{
"error": {
"message": "<string>"
}
}
{
"error": {
"message": "<string>"
}
}
{
"error": {
"message": "<string>"
}
}
{
"error": {
"message": "<string>"
}
}
Use this endpoint to poll a run until it reaches completed, failed, or cancelled.

Get your Exa API key

Authorizations

x-api-key
string
header
required

Pass your Exa API key in the x-api-key header. You can also authenticate with Authorization: Bearer .

Path Parameters

id
string
required

Agent run ID.

Required string length: 1 - 200
Pattern: ^[A-Za-z0-9_.:-]+$
Example:

"agent_run_01j7x9v0m2n4p6q8r0s2t4v6w8"

Response

Agent run

id
string
required

Agent run ID. New run IDs are returned with the agent_run_ prefix.

Required string length: 1 - 200
Pattern: ^[A-Za-z0-9_.:-]+$
Example:

"agent_run_01j7x9v0m2n4p6q8r0s2t4v6w8"

object
string
required
Allowed value: "agent_run"
status
enum<string>
required
Available options:
queued,
running,
completed,
failed,
cancelled
stopReason
enum<string> | null
required

Why the run stopped. null while the run is queued or running.

Available options:
schema_satisfied,
budget_reached,
error,
cancelled
createdAt
string<date-time>
required

When the run was created

completedAt
string<date-time>
required
request
object | null
required

Canonicalized request fields stored with the run.

output
object
required
usage
object
required
costDollars
object
required