Advanced Agent

Beta
This endpoint engages advanced agents that use tools, multi-turn reasoning, and planning to solve complex queries. The agents break down each query into a workflow, execute the steps iteratively, and reflect on the findings before generating a final response. Use it for answering complex questions that require in depth responses. The data returns as a JSON payload with a `application/json` content type. <Info>The call only returns when the agent has finished fully responding to the input question.</Info>

Authentication

AuthorizationBearer

A unique API Key is required to authorize API access. For details, see how to get your API Key.

Request

This endpoint expects an object.
agentenumRequired
Setting this value to "advanced" is mandatory to use the advanced agent.
Allowed values:
inputstringRequired
The question you'd like to ask the agent
streamfalseRequired

Must be set to true when you want to stream the agent response as its being generated, and false when you want the response to return after the agent has finished.

toolslist of objectsOptional
The advanced agent accepts either `compute` or `research` tools <Note> Compute allows your agent to use a Python code interpreter for tasks such as data analysis, mathematical calculations, and plot generation.<br><br> Research iteratively searches the web, analyzes the results, and stops when finished. It then provides a comprehensive report to your agent with current, cited information.</Note>
verbosityenumOptional

Controls the level of detail provided by the agent’s response. Choosing high maps to a long-form report while medium maps to a medium verbosity report that captures most details but is less comprehensive.

Allowed values:
workflow_configobjectOptional

Defines the maximum number of steps the agent uses in its workflow plan to answer your query. Higher values allow for more tool calls, but it takes longer for the agent to provide the response. For instance, setting max_workflow_steps=5 could allow the agent to call the research tool 3 times and the compute tool 2 times.

Response

agentstring
The id of the agent populated in the request.
inputobject
The users access role and question you asked the agent
outputobject
The response populated by the agent.

Errors