Query Parameters
The session ID to continue the agent session conversation. If not provided, a
new agent session will be created.
Request Body
The task or message to run the agent with.
A system prompt to provide system information to the agent. The Agents API
defaults to the Agentbase default system prompt.
The mode of the agent. Can be
flash, fast or max. Flash mode is great
for simple, one-off tasks. Fast mode is much faster and cheaper, with
comparable performance to max mode. The Agents API defaults to fast.A set of declarative workflows for the agent to execute. Each workflow is a
DAG (Directed Acyclic Graph) of steps that the agent interprets and executes
dynamically. The agent decides how to implement each step based on its
description, making this a truly AI-native workflow system rather than a
deterministic workflow builder.Workflow Schema:
id(string, required): Unique identifier for the workflowname(string, required): Name of the workflowdescription(string, required): What the workflow accomplishessteps(array, required): Array of step objects
id(string, required): Unique identifier for the stepname(string, required): Name of the stepdescription(string, required): What the step should accomplish - the agent interprets this to decide HOW to executedepends_on(string[], required): Array of step IDs that must complete before this step runs. Empty array means the step can run immediately. Steps with no dependencies run in parallel.
optional(boolean, optional): Whether the step can be skipped if it failsretry_policy(object, optional): Retry configuration for the stepoutput_schema(object, optional): JSON schema for expected output validation
A set of rules to provide to the agent. Rules are a set of constraints that
the agent must follow. Defaults to no rules.
A set of agent configurations that enables the agent to transfer conversations to other specialized agents. When provided, the main agent will have access to seamless handoffs between agents based on the conversation context.This enables multi-agent workflows where specialized agents handle specific types of requests.
A set of MCP servers to provide to the agent. MCP servers configs are not
stored within the agent, so each request must include the MCP servers configs,
and you can modify them each time. You need to provide both
serverName and
serverUrl. Optionally include auth for authentication. We have backward compatibility with the old /sse endpoint.Whether to run the agent asynchronously on the server. When set to
true, the
agent runs in the background and you can use the callback parameter to
receive agent message events. Defaults to false.A callback endpoint configuration to send agent message events back to. Use
this with
background: true to receive events at your specified endpoint.A set of datastores to provide to the agent. Datastores are a set of data
sources that the agent can utilize. Datastores are either databases or
documents as the knowledge base.
A set of custom actions based on datastore (database) queries. Allows you to
quickly define actions that the agent can use to query your datastores.
Whether to stream the agent messages token by token. Defaults to
false.A set of scheduled tasks to run the agent with messages at specific times or intervals. Each schedule can be defined using:Each scheduled task will trigger the agent with the specified message at the scheduled time. Returns task IDs that can be used to cancel schedules later.
- A number (seconds from now):
10runs in 10 seconds - A Date string:
"2025-01-01"runs at that specific date/time - A cron expression:
"*/10 * * * *"runs every 10 minutes
Configuration for an extra final output event that processes the entire agent
message thread and produces a structured output based on the provided JSON
schema.