Optional providerProvider name. When supplied without model, the default text model for
the provider is resolved automatically.
`"openai"`, `"anthropic"`, `"ollama"`
Optional modelModel identifier. Accepts "provider:model" or plain model name with provider.
`"openai:gpt-4o"`, `"gpt-4o-mini"`
Zod schema defining the expected output shape.
Optional schemaHuman-readable name for the schema, injected into the system prompt.
`"ShoppingList"`
Optional schemaDescription of the schema, injected into the system prompt.
`"A shopping list with a person's name and items."`
Optional promptUser prompt.
Optional systemSystem prompt. Schema instructions are appended automatically.
Optional messagesFull conversation history.
Optional temperatureSampling temperature forwarded to the provider.
Optional maxHard cap on output tokens.
Optional maxNumber of retries on validation failure. Unlike generateObject, streaming retries are not currently supported (the stream is consumed once). This field is accepted for API symmetry but is unused; validation errors on the final object throw immediately.
0
Optional apiOverride the API key.
Optional baseOverride the provider base URL.
Options for a streamObject call.
Shares the same shape as GenerateObjectOptions from generateObject. At minimum,
schemaand eitherpromptormessagesmust be supplied.Example