Skip to main content

Receive the Final Report

Read the event stream and print final_result.result once it arrives. This is the authoritative report. stream: true additionally emits provisional text deltas; concatenating all of them mixes partial and final drafts. For a live text display, track each delta’s phase and checkpoint and handle synthesis_discarded.

Reconnect to a Run

events() attaches to a run that is already running, replays its saved events, and follows it until done. Pass the last event id you saw to resume without replaying. Stopping the loop detaches without cancelling the run.

Restrict Research to Trusted Domains

Use include to prioritize domains while retaining other results. Use exclusive to restrict results to the allowlist. Blocked domains are always removed. Each list accepts at most 150 entries.

Continue Research

Each follow-up starts a new run with a new research_run_id. Use the session_id from the SSE session event to continue that conversation. Set the mode, domain filter, and output language explicitly on the new request when you need them; do not assume the previous request settings are inherited.
If you only have a run ID, including after an async start, wait for that run to complete and pass it as prior_run_id to carry its report and source context into a new run. Do not send both continuation fields.
Completed follow-ups use the same mode-based pricing as other runs. See follow-up billing.

Retrieve Saved Runs

Pass page.pagination.next_cursor as cursor to get the next page.

Cancel a Running Run

A run that already finished returns its status with cancelled: false.