Structured output - Browser Use
Skip to main content
Pass a JSON Schema as output_schema / outputSchema. When the run completes, run.output holds the parsed JSON value and run.result still holds the text answer. A task sent with an outputSchema starts a run. When it completes, run.result holds the text answer and run.output holds the parsed JSON, checked against the schema. A task sent with an outputSchema starts a run. When it completes, run.result holds the text answer and run.output holds the parsed JSON, checked against the schema.
SDK support for output_schema / outputSchema and run.output ships in the first browser-use-sdk release after 3.11.3. On 3.11.3, use the REST API.
Browser Use checks the agent’s final answer against the schema. If the agent cannot produce a matching answer, the run fails with Could not produce output matching outputSchema. Validate run.output in your application as well, as the examples do.

Limits

  • API-key runs only. Runs started from the dashboard return 422.
  • JSON Schema 2020-12 unless the schema sets another $schema.
  • At most 64 KiB, 64 nesting levels, and about 4,000 values (every key’s value and array item counts).
  • $ref must point inside the schema (#/...).