Your servers can run any agent with a secret key. A browser can run an agent only when its Who may run it rule allows the signed-in user (or anyone). See Create an agent.
List the agents you can run
Ask it something
Continue a conversation
Pass thethread of an earlier run to carry on, so the agent remembers what was said.
Stream each step
Show the answer as it is written, and show what the agent is doing:
A failure ends the stream with an error.
Don’t wait: run in the background
For long jobs, start the run and come back to it:get(id), or have a flow start when it finishes, so you never poll.
Approve or decline what it asks
Whenstatus is waiting, pending lists what the agent wants to do. Show it to the right person, then decide:
decisions is a yes or no for each waiting call by its id, and approve answers any you did not name. Approving carries the run on; declining tells the agent no.
Only the person who started the run, or someone allowed by the agent’s approval rule, can decide.
Over HTTP
"stream": true for server-sent events, "background": true to return at once, and "thread": "<id>" to continue a conversation. Read a run with GET /ai/v1/agent-runs/<id> and decide it with POST /ai/v1/agent-runs/<id>/decide.