Skip to main content
Use this page when you already understand the Agent SDK workflow and need the exact public entry point or option to reach for.

Entry points

Agent methods

Stream consumers

Definition options

AgentDefinition includes:
  • id
  • model or models
  • preset
  • instructions
  • tools
  • maxSteps and stopWhen
  • modelRetry and toolExecution
  • temperature, maxOutputTokens, and topP
  • parseOutput and outputSchema
  • requireApproval and humanReview
Model, instruction, and sampling fields can use fixed or dynamic values.

Run and continuation options

AgentRunOptions supplies input, the model client, application context, optional overrides, cancellation, lifecycle hooks, DevTools, and an application-owned state accessor. AgentContinueOptions additionally accepts:
  • a prior run or runId
  • humanInput
  • approvals and rejections by exact tool-call ID
  • externally produced toolOutputs

Result records

AgentRunResult contains:
  • run: durable run status, context, pause details, and stop reason
  • steps: persisted model/tool step records
  • stepResults: normalized step results when available
  • usage: cumulative tokens and reported cost
  • output: parsed final output
  • messages: the complete conversation used by the loop
  • items: ordered typed messages, reasoning, tool activity, errors, and final output

Error types

  • AgentGatewayError describes gateway or upstream request failures.
  • AgentSchemaValidationError describes invalid tool, progress, or final-output data.
Last modified on July 26, 2026