OpenRouter exposes provider-level controls such as preferred provider routing and reasoning effort that have no equivalent in the standard AI SDK builder interface. These are passed through theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/openrouter/llms.txt
Use this file to discover all available pages before exploring further.
providerOptions('openrouter', [...]) builder method and merged directly into the outgoing request body, giving you access to any OpenRouter-specific top-level field without losing the type-safe builder API.
Basic example
The raw key
Everything placed inside the raw array is merged directly into the top-level JSON request body that is sent to OpenRouter. This means you can set any OpenRouter-specific field — provider, reasoning, transforms, and so on — without the SDK needing explicit support for each one. Fields inside raw take effect for both text and image generation requests.
Common use cases
Provider routing
Control which upstream providers OpenRouter is allowed to route your request to, and in what priority order:Reasoning effort
For models that support extended thinking, set the reasoning effort level to balance quality against cost and latency:'low', 'medium', and 'high'.
Image style options (Recraft)
Provider-level style options for image models are also passed throughraw. The following example sets the Recraft style to vector:
provider.options.recraft.style field is forwarded as a top-level provider key in the request body, exactly as OpenRouter expects.