run() a schema and the report comes back with typed output.
Typed output
output takes any AI-SDK FlexibleSchema — a zod schema is the usual one —
and the result is validated before it reaches you. T is inferred from
the schema, so report.output is typed without a cast.
Leave output unset and it costs nothing: no schema is sent, and
report.output is simply absent.
status is "ok", "error", or "stopped". Check it before you trust
output — a run that was aborted or hit its maxToolCalls budget is
"stopped", and it still returns a report.Meter on usage
Every report carries the run’s token totals. This is the number to bill,
budget, and alert on — nothing else in the SDK counts for you.
report.toolCalls is the other half of the picture: the calls the run
attempted, in order, each with the outcome the guard returned. A run that came
back "ok" with zero tool calls answered from the model alone.
Cancel it
There is nocancel(). Cancellation is an AbortSignal, the same as
everywhere else on the platform:
Ship it as a product surface
The same run, streamed to a screen you built.
Reference
Every field on
AgentReport, including refs and usage.