Discover the flexibility of our Preferred Routing feature, designed to give users control over how their AI requests are handled when multiple providers are available for a selected model. With this feature, users can specify routing based on price or performance, ensuring that their needs are always met, whether focused on cost efficiency or response speed.
Preferred Routing offers a highly customizable approach to handling AI requests by allowing users to choose between the most cost-effective or the fastest provider. This is particularly useful for businesses that either want to minimize operational costs or prioritize performance for critical use cases.
Using Preferred Routing in your AI workflows is simple. Here's a typical API call with the routing parameter:
curl -L -X POST 'https://apipie.ai/v1/chat/completions' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"messages": [
{
"role": "system",
"content": "why is the sky blue?"
}
],
"model": "gpt-3.5-turbo",
"routing": "perf", //route to the most responsive provider of this model
"temperature": 1,
}'
This example demonstrates how to use the routing parameter in an API request. By default, the routing option is set to perf, but users can modify it to either price or perf-avg based on their needs.
By offering both price-based and performance-based routing, Preferred Routing allows businesses to customize their AI deployments to meet different operational goals:
To start using Preferred Routing effectively, follow these steps:
routing parameter and set it to either price, perf, or perf-avg depending on your needs.perf, which selects the most responsive provider based on your prompt size.Preferred Routing offers users the flexibility to prioritize either cost savings or performance when making AI requests. Whether your focus is on efficiency or speed, this feature ensures that your needs are met seamlessly across multiple providers.
Configuration State Management
Learn how to manage application and user state with APIpie by Neuronic AI. Configure state via Inline CLI, API, or GUI. Includes examples, features, and best practices.
Minimize AI Hallucinations with Integrity
Enhance AI accuracy with our Integrity feature, reducing errors and ensuring reliable results for critical business applications. Explore its benefits today!