Introduction

Quick start

Two requests: create a task and poll for the result. You will need a JWT and an assistant ID.

1. Create a task

POST /api/tasks
bash
curl -X POST https://agent.aist-ai.com/api/tasks \
  -H "Authorization: Bearer <jwt>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  --data-binary '{
    "assistant_id": 1,
    "input": [
      { "type": "text", "text": "Hi! Who are you?" }
    ]
  }'
response
{ "uuid": "550e8400-e29b-41d4-a716-446655440000", "status": "pending" }

2. Fetch the result

GET /api/tasks/{uuid}

Poll the endpoint until status becomes terminal (completed or failed):

bash
curl https://agent.aist-ai.com/api/tasks/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer <jwt>" \
  -H "Accept: application/json"
response
{
  "uuid": "550e8400-...",
  "status": "completed",
  "turn": {
    "output": [{ "type": "text", "text": "I'm an AI assistant…" }],
    "messages": [/* full LLM history */],
    "metadata": { "model": "claude-sonnet-4-6", "cost": { "total": 0 } }
  },
  "error": null,
  "created_at": "2026-07-08T10:00:00Z",
  "completed_at": "2026-07-08T10:00:04Z"
}
Don't want to poll?
Pass a callback_url when creating the task, and Agent will send you the result as soon as it's ready. See Webhooks.

Next steps