Agent

Multi-step research agent that autonomously searches, reads, and reasons across multiple sources.

POST /v1/agent

The Agent endpoint launches an autonomous research loop. It plans search queries, executes them, reads results, and iterates until it has enough information to produce a comprehensive answer.

How the autonomous research loop works:

  1. 1Planning — the agent analyses your question and creates a research plan with 2-5 sub-queries to explore different aspects of the topic
  2. 2Search execution — it runs the planned searches across multiple engines in parallel
  3. 3Content extraction — the most relevant results are scraped to get full page content
  4. 4Analysis and reasoning — the agent reads all extracted content, identifies key facts, patterns, and insights
  5. 5Iterative refinement — based on what it learned, the agent may generate additional follow-up queries to fill knowledge gaps
  6. 6Synthesis — after all steps complete, the agent synthesises a comprehensive answer with source citations

Each step is visible in the response via the steps_completed field. More steps mean deeper research but also more time and resources.

Request Body

NameTypeDescription
qrequired
stringThe research question or task. 1-1000 characters. Be specific for best results — the agent works better with focused questions.
steps
integerMaximum number of research steps. 1-20, default: `5`. More steps = deeper research. Each step may involve 1-3 searches and 1-2 scrapes.

Credit Cost

The Agent costs 15 credits per request regardless of step count. This is a flat rate that covers:

  • Up to 20 research steps (default 5)
  • Multiple search calls per step
  • Content extraction from top results
  • AI reasoning across all gathered information
  • Final synthesis and citation generation

The flat rate means you can increase the steps parameter for deeper research without worrying about variable credit costs. Credits are deducted upfront — if the agent fails after deduction, credits are refunded.

Response

Successful agent response:

json

SDK Examples

Agent using each SDK:

python
javascript
go

Error Codes

This endpoint can return the following errors:

Errors

NameTypeDescription
INVALID_QUERY
400Missing or empty `q` field, query exceeds 1000 characters, or `steps` is outside the 1-20 range.
INSUFFICIENT_CREDITS
402Not enough credits. Agent costs 15 credits per request.
USER_RATE_LIMITED
429You've exceeded your plan's per-minute rate limit.
ENGINE_ERROR
502One or more underlying search/scrape operations failed. The agent will attempt to continue with remaining sources. Credits are refunded only if the entire request fails.

Need help?

Check our error codes or reach out to the team.