Run an agent with a message and receive a streaming agent response.
flash, base or max. Flash mode is great
for simple, one-off tasks. Base mode is much faster and cheaper, with
comparable performance to max mode. The Agents API defaults to base.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 objectsid (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 validationserverName and
serverUrl. Optionally include auth for authentication. We have backward compatibility with the old /sse endpoint.true, the
agent runs in the background and you can use the callback parameter to
receive agent message events. Defaults to false.background: true to receive events at your specified endpoint.false.10 runs in 10 seconds"2025-01-01" runs at that specific date/time"*/10 * * * *" runs every 10 minutes