Skip to main content
The config object is used to configure API interactions with various providers. It supports multiple modes such as single provider access, load balancing between providers, and fallback strategies. The following JSON schema is used to validate the config object:

Example Configs

You can find more examples of schemas below.

Schema Details

Strategy Object Details

Cache Object Details

Retry Object Details

Circuit Breaker Object Details

Cloud Provider Params (Azure OpenAI, Google Vertex, AWS Bedrock)

Azure OpenAI

Google Vertex AI

AWS Bedrock

Notes

  • The strategy mode key determines the operational mode of the config. If strategy mode is not specified, a single provider mode is assumed, requiring either provider and api_key or virtual_key.
  • In loadbalance and fallback modes, the targets array specifies the configurations for each target.
  • The cache and retry objects provide additional configurations for caching and retry policies, respectively.

Examples


Single Provider with Provider Slug

The simplest and recommended way to configure a provider.

Provider Slug with Model & Hyperparameters

Override the model and set custom parameters.

Provider Slug with Cache and Retry

Enable semantic caching and retry on specific status codes.

Load Balancing with Provider Slugs

Distribute traffic across multiple providers.

Fallback Across Providers

Automatically failover to backup providers on errors.

Load Balancing and Fallback Combination

Nest strategies for complex routing logic.

Single Provider with Provider API Key

OpenAI:
Anthropic:

Legacy: Single Provider with Virtual Key

Still Supported but we recommend using the provider slug instead
Last modified on April 8, 2026