How Routing Works
YouRouter offers two modes for routing your API requests: automatic and manual. This behavior is controlled by thevendor
header.
Default Behavior: Automatic Routing (auto
)
For maximum reliability, we recommend using our automatic routing mode. This is the default behavior if you omit the vendor
header or set it to auto
.
In auto
mode, YouRouter intelligently routes your request to the most available and cost-effective provider for the requested model. For example, if you request gpt-4o
and OpenAI’s API is experiencing latency, we will seamlessly failover to another provider like Azure OpenAI to ensure your request is processed without interruption. This is the ideal setting for production applications where high availability is critical.
Manual Routing: Specifying a Provider
If you need to use a specific model from a particular provider or access a provider-exclusive feature, you can manually route your request. To do this, simply set thevendor
header to the desired provider’s ID.
For instance, to guarantee your gpt-4o
request is handled by Azure, you would include vendor: azure
in your request header.
Available Providers
Provider | vendor Value |
---|---|
Anthropic | anthropic |
AWS Bedrock | aws |
Azure OpenAI | azure |
DeepSeek | deepseek |
google | |
Mistral AI | mistral |
OpenAI | openai |
Volcengine | volcengine |
xAI | x |
Zero Completion Insurance
Our fair billing policy ensures you only pay for successful, non-empty responses. You will not be charged for requests that result in an error (e.g., a 500 status code) or return zero completion tokens. This is our Zero Completion Insurance, and it’s enabled by default on all requests.Best Practices
- Use
auto
for Production: For any application where uptime is important, we strongly recommend using the defaultauto
mode to benefit from our automatic failover and high-availability routing. - Use Manual Routing for Specific Needs: If you require a model or feature unique to one provider, specify the provider using the
vendor
header. - Consult Provider-Specific Docs: When using manual routing to access special features, always refer to the native provider’s documentation for detailed parameter information. You can pass these parameters directly through YouRouter, as explained in our Request Forwarding guide.