Execute a task using the Lumo AI agent platform with real-time streaming via Server-Sent Events (SSE). The agent will automatically select and execute the appropriate tools based on the task requirements. Supports both function-calling and code-based agents. Returns events as they occur, including token-by-token output and step updates.
/stream endpoint provides real-time streaming of agent execution using Server-Sent Events (SSE). It accepts the same parameters as the /run endpoint but returns events as they occur, allowing you to monitor the agent’s progress, see token-by-token output, and receive step updates in real-time.
agent_type: "code-agent" to use this agent type.
mcp_servers configuration. Ideal for:
agent_type: "mcp" to use this agent type.
text/event-stream content typedata: and followed by \n\ndone event containing the final answer and token usagekeep-alive headerno-cache headerBearer token authentication. Get your API key from https://lumo.starlight-search.com/dashboard
Task configuration and parameters
The task description that the agent should complete. This can be a question, instruction, or complex multi-step task.
"What is the weather in Berlin?"
The AI model identifier to use for the task. This should match the model format expected by your base_url provider (e.g., OpenAI, Anthropic, etc.).
"gpt-4.1-nano"
The base URL for the chat completions API endpoint. This should point to your model provider's API.
"https://api.openai.com/v1/chat/completions"
Array of tool identifiers available to the agent. The agent will automatically select and use these tools as needed to complete the task.
[
"DuckDuckGo",
"VisitWebsite",
"GoogleSearchTool",
"ExaSearchTool",
"PythonInterpreter"
]Maximum number of steps the agent can take to complete the task. If not specified, the agent will continue until the task is completed or reaches a timeout.
x >= 13
Type of agent to use. 'function-calling' uses traditional function selection and execution. 'code-agent' uses executable Python code as actions, providing greater flexibility and efficiency for complex tasks. 'mcp' uses Model Context Protocol remote servers to connect to self-hosted toolchains.
function-calling, code-agent, mcp Array of MCP remote server configurations. Required when agent_type is 'mcp'. Each server configuration specifies how to launch and connect to an MCP server.
[
{
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.linear.app/sse",
"--header",
"Authorization: Bearer ${AUTH_TOKEN}"
],
"env": { "AUTH_TOKEN": "YOUR-AUTH_TOKEN" }
}
]Optional conversation history or system messages. If not provided, the task will be treated as a standalone request.
Optional conversation history as an array of Message objects. Alias for 'messages'.
Maximum number of results for search tools (default: 5 for ExaSearchTool).
x >= 15
Custom system prompt to override the default system prompt for the agent.
"You are a helpful assistant specialized in weather information."
Interval for planning steps (for function-calling and mcp agents). The agent will pause for planning after this many steps.
x >= 13
Task execution stream (Server-Sent Events)
Server-Sent Events stream. Each event is prefixed with 'data: ' and followed by '\n\n'. Event types include: 'token' (token-by-token content), 'step' (step completion with tool calls), 'error' (error messages), and 'done' (final answer and token usage).