Assisters API
API Reference

Agent

Run autonomous research and coding agents with streaming progress events

Agent

Run an autonomous agent that plans, searches the web, fetches URLs, and reasons across multiple cycles to answer a query. Two endpoints are available: a non-streaming run that returns the final result, and a streaming stream that emits Server-Sent Events as the agent works.

Agent endpoints require the Max tier. Requests from lower tiers receive a 403.

Run (non-streaming)

Endpoint

POST https://api.assisters.dev/v1/agent/run

Request Body

stringrequired

The task or question for the agent to work on.

stringdefault: research

The agent behavior profile. Options: chat, research, coding.

string

An optional session identifier to continue a previous agent conversation.

integer

Maximum number of reasoning cycles. Range: 1 to 8.

Example

import httpx

response = httpx.post(
    "https://api.assisters.dev/v1/agent/run",
    headers={"Authorization": "Bearer ask_your_api_key"},
    json={
        "query": "Summarize the latest advances in retrieval-augmented generation.",
        "mode": "research",
        "maxCycles": 5,
    },
    timeout=120,
)

print(response.json())
const response = await fetch("https://api.assisters.dev/v1/agent/run", {
  method: "POST",
  headers: {
    "Authorization": "Bearer ask_your_api_key",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: "Summarize the latest advances in retrieval-augmented generation.",
    mode: "research",
    maxCycles: 5,
  }),
});

console.log(await response.json());
curl https://api.assisters.dev/v1/agent/run \
  -H "Authorization: Bearer ask_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Summarize the latest advances in retrieval-augmented generation.",
    "mode": "research",
    "maxCycles": 5
  }'

Response

Returns the final agent result as JSON. The exact shape depends on the agent's run, and typically includes the synthesized answer along with the steps, tool calls, and sources gathered along the way.

{
  "answer": "Recent RAG advances include...",
  "steps": [],
  "sources": []
}

Stream (Server-Sent Events)

Endpoint

GET https://api.assisters.dev/v1/agent/stream

Query Parameters

stringrequired

The task or question for the agent to work on.

stringdefault: research

The agent behavior profile. Options: chat, research, coding.

string

An optional session identifier to continue a previous agent conversation.

integer

Maximum number of reasoning cycles. Defaults to 1 for chat mode and 5 otherwise.

Response

A text/event-stream of Server-Sent Events. Each event is a JSON-encoded agent event on a data: line. The stream ends with a done (or error) event followed by data: [DONE].

data: {"type":"step","message":"Searching the web for RAG advances"}

data: {"type":"tool","name":"web_search","status":"completed"}

data: {"type":"done","answer":"Recent RAG advances include..."}

data: [DONE]

Example

const params = new URLSearchParams({
  query: "Summarize the latest advances in retrieval-augmented generation.",
  mode: "research",
});

const response = await fetch(
  `https://api.assisters.dev/v1/agent/stream?${params}`,
  { headers: { Authorization: "Bearer ask_your_api_key" } },
);

const reader = response.body.getReader();
const decoder = new TextDecoder();

while (true) {
  const { value, done } = await reader.read();
  if (done) break;
  for (const line of decoder.decode(value).split("\n")) {
    if (line.startsWith("data: ")) {
      const payload = line.slice(6);
      if (payload === "[DONE]") break;
      console.log(JSON.parse(payload));
    }
  }
}
curl -N "https://api.assisters.dev/v1/agent/stream?query=Summarize%20RAG%20advances&mode=research" \
  -H "Authorization: Bearer ask_your_api_key"

Error Responses

Service Status

Check live API uptime and incidents