This integration method is maintained but no longer actively developed. For the best experience and latest features, use our new AI Gateway with unified API access to 100+ models.
This feature is currently in beta. While you're welcome to try it out, please know that our team is still working to refine it. Your feedback is valuable to help us improve!
Introduction#
Given the instability of some APIs and the multitude of similar providers, we have developed a unified gateway that acts as a single endpoint for accessing multiple APIs.
Why Gateway Fallbacks#
Instead of using the Helicone-Target-Url header to send requests to a specific API, you can use this unified gateway to:
- Automatically switch to fallback options in case of an API failure or error response.
- Eliminate the need to modify your code when switching providers.
- Maintain high availability and reliability in critical applications that depend on external APIs.
Getting Started#
To get started, add the header Helicone-Fallbacks to your request.
This header should contain a JSON string dump of the fallbacks you wish to use. The fallbacks are prioritized, meaning the first one will be used if available. If it is not available, the system will attempt to use the next one, and so on.
The header is structured as follows:
Extracting Fallbacks Response Header#
When fallbacks is enabled, you can capture the fallback index from the headers of the response returned.
Example#
Using the OpenAI API and set LemonFox API as fallback, then extracting the header.
For integration with other languages, please refer to the format in Header Directory.
Limitations#
Using Approved Domains#
Helicone supports integration with several approved domains for providers such as OpenAI, Anthropic, Together-AI, OpenRouter, and Azure.
Choosing from our latest list of approved domains as fallbacks means you can send unlimited requests to the providers via Helicone.
Using Unapproved Domains#
You can also use unapproved domains as fallbacks. However, to protect our community from potential threats, we have certain restrictions for unapproved domains:
- 10,000 requests per day
- 1 request per second
