Skip to main content
A task is the core primitive. Describe what you want in plain text, the agent browses the web and returns the result.

run()

Runs the task and returns a TaskResult with typed output.

Structured output

Pass a schema to get validated, typed data back.

Streaming steps

Use async for to yield steps as the agent works.

Message streaming (v3)

In the BU Agent API, use sessions.messages() to poll the agent’s message history while a task runs. This gives you the full conversation — user messages, assistant reasoning, and tool calls.
Use after and before cursors for pagination through large message histories.

Files

Upload images, PDFs, documents, and text files (10 MB max) to sessions, and download output files from completed tasks.

Upload a file

Get a presigned URL, then upload via PUT.
Presigned URLs expire after 120 seconds. Max file size: 10 MB.

Download task output files

Key parameters