Ask the agent
Run the NeuroAPI agent and return the answer.
Run the NeuroAPI agent and return the answer.
Defaults: mode=smart, stream=false. With stream=false the
response is a single JSON document. With stream=true it is an SSE
stream (text/event-stream) where each event is one
TaskResponseMessage from the agent and the stream terminates with
data: [DONE]\n\n on success.
Optional system_prompt augments the agent's instructions (it never
overrides its persona or safety guardrails). Optional output_schema
(a JSON Schema) makes the agent return a validated object in output
(answer is then null - exactly one is set); it requires
stream=false.
Every response carries an X-Request-Id header that mirrors
AgentAskResponse.request_id. Pass it back when reporting issues.
Authorization
APIKeyHeader In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://api.neurobro.ai/api/v1/agent/ask" \ -H "Content-Type: application/json" \ -d '{ "mode": "smart", "prompt": "Summarise the latest macroeconomic outlook for the eurozone.", "stream": false }'{
"answer": "The European Central Bank held rates steady ...",
"mode": "smart",
"request_id": "8b3a2f0e-1d7e-4c6b-9b2a-f5e23a1c9d44",
"usage": {
"cached_tokens": 80,
"completion_tokens": 256,
"cost_units": 2,
"prompt_tokens": 124
}
}