Description
This endpoint answers the user’s query with an LLM using web results (max 1 web search) to ground the answer. Use it for answering simple questions that involve a web search that require a low latency agent.Errors
The endpoint returns as a structured JSON object withstatus
, code
, title
, and detail
fields:
HTTP | Code | When it happens |
---|---|---|
400 | bad_request | Invalid request body (e.g., tools must be an array of objects) |
401 | unauthorized | Missing or invalid Authorization header (use a valid <API_KEY> ) |
403 | forbidden | You are not allowed to run this agent or the requested tool |
Streaming Example (SSE)
Authorizations
The unique API Key required to authorize API access. Learn how to get yours in the “Get your API key” section of the documentation.
Body
application/json
The agent mode that will be used to execute your request. This parameter must be set as 'express'.
The input for the agent. This can be a query or a prompt.
Example:
"What is the capital of France?"
When set to "true", it will enable SSE (server side events) response. This is useful if you want to stream the response to your applications (e.g., with chatbots).
Add tools the system can call to expand its capabilities, providing more precise answers to the input query. Currently supports only the Web Search tool. See Web Search Tool for more details.
Response
Inference response in application/json or text/event-stream format.