Menu
Important
Stay updated on React2Shell

Provider Options

Last updated December 2, 2025

AI Gateway can route your AI model requests across multiple AI providers. Each provider offers different models, pricing, and performance characteristics. By default, Vercel AI Gateway dynamically chooses the default providers to give you the best experience based on a combination recent uptime and latency.

With the Gateway Provider Options however, you have control over the routing order and fallback behavior of the models.

If you want to customize individual AI model provider settings rather than general AI Gateway behavior, please refer to the model-specific provider options in the AI SDK documentation.

You can use the array to specify the sequence in which providers should be attempted. Providers are specified using their string. You can find the slugs in the table of available providers.

You can also copy the provider slug using the copy button next to a provider's name on a model's detail page. In the Vercel Dashboard:

  1. Click the AI Gateway tab,
  2. Then, click the Model List sub-tab on the left
  3. Click a model entry in the list.

The bottom section of the page lists the available providers for that model. The copy button next to a provider's name will copy their slug for pasting.

  1. First, ensure you have the necessary package installed:

  2. Use the configuration:

    In this example:

    • The gateway will first attempt to use Amazon Bedrock to serve the Claude 4 Sonnet model
    • If Amazon Bedrock is unavailable or fails, it will fall back to Anthropic
    • Other providers (like Vertex AI) are still available but will only be used after the specified providers
  3. You can monitor which provider you used by checking the provider metadata in the response.

The value is the amount debited from your AI Gateway Credits balance for this request. It is returned as a decimal string. The represents the market rate cost for the request. The is a unique identifier for this generation that can be used with the Generation Lookup API. For more on pricing see Pricing.

In cases where your request encounters issues with one or more providers or if your BYOK credentials fail, you'll find error detail in the field of the provider metadata:

Use the array to restrict routing to a specific subset of providers. Providers are specified by their slug and are matched against the model's available providers.

In this example:

  • Restriction: Only and will be considered for routing and fallbacks.
  • Error on mismatch: If none of the specified providers are available for the model, the request fails with an error indicating the allowed providers.

When both and are provided, the filter is applied first to define the allowed set, and then defines the priority within that filtered set. Practically, the end result is the same as taking your list and intersecting it with the list.

The final order will be (providers listed in but not in are ignored).

You can specify fallback models that will be tried in order if the primary model fails or is unavailable. This provides model-level fallback in addition to provider-level routing.

In this example:

  • The gateway will first attempt to use the primary model ()
  • If the primary model fails or is unavailable, it will try
  • If that also fails, it will try
  • The response will come from the first model that succeeds

You can combine model fallbacks with provider routing options for comprehensive failover strategies:

This configuration will:

  1. Try via Azure first, then OpenAI
  2. If both fail, try via Azure first, then OpenAI
  3. If those fail, try via available providers

You can combine AI Gateway provider options with provider-specific options. This allows you to control both the routing behavior and provider-specific settings in the same request:

In this example:

  • We're using an Anthropic model (e.g. Claude 4 Sonnet) but accessing it through Vertex AI
  • The Anthropic-specific options still apply to the model:
    • sets a cost limit of $0.001 per request for the Claude model
  • You can read more about provider-specific options in the AI SDK documentation

For models that support reasoning (also known as "thinking"), you can use to configure reasoning behavior. The example below shows how to control the computational effort and summary detail level when using OpenAI's model.

For more details on reasoning support across different models and providers, see the AI SDK providers documentation, including OpenAI, DeepSeek, and Anthropic.

Note: For and models, you must set both and in to receive reasoning output.

You can view the available models for a provider in the Model List section under the AI Gateway tab in your Vercel dashboard or in the public models page.

Provider availability may vary by model. Some models may only be available through specific providers or may have different capabilities depending on the provider used.


Was this helpful?

supported.