The AI Router offers three distinct operating modes to accommodate various privacy requirements and integration scenarios. The Model Routing mode provides the most streamlined experience, directly handling model calls and returning responses. For organizations with private models or specific security needs, Model Selection mode returns only the best model which can then be called manually. The Full Privacy mode offers maximum data protection by accepting pre-computed embeddings for the model selection.
Model routing and model selection are available on all paid plans; full privacy mode is a plan feature, see the pricing page. Requests on a plan without the feature receive a 403 with an explanatory message.
Model Selection mode enables you to leverage AI Router's smart model selection while maintaining complete control over model execution. This mode is particularly valuable for organizations that:
Instead of routing your requests through the AI Router, you receive the model recommendation and handle the execution within your environment. This provides the flexibility to integrate with private deployments while benefiting from AI Router's model selection capabilities.
Without an SDK, call the Decision API directly. It returns the ranked candidates together with a decision_id; report the usage of the completion you execute through the usage report API so that your dashboards, savings reports and billing reflect actual usage.
Full Privacy mode represents the highest level of data protection, ensuring your input content never leaves your environment. In this mode:
By default, the AI Router SDK uses FastEmbed with the paraphrase-multilingual-mpnet-base-v2 model to generate embeddings. If you already have existing text-embedding-3-small embeddings or prefer these, you can use them by handing them in and setting the embedding type:
Embed the concatenated message contents (joined by a single space, newlines replaced by spaces) so the embedding matches what the SDK would have produced.
If you already have different embeddings you'd like to use, we'll integrate them for you - please contact us at support@airouter.io to discuss compatibility options.
This approach is ideal for organizations handling sensitive data or those subject to strict privacy regulations, as it maintains complete control over raw input data.
from airouter import AiRouter
client = AiRouter(
api_key="<THE-API-KEY-YOU-GENERATED>"
)
model_name = client.get_best_model(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the meaning of life?"}
]
)
from airouter import AiRouter
client = AiRouter(
api_key="<THE-API-KEY-YOU-GENERATED>"
)
model_name = client.get_best_model(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the meaning of life?"}
],
full_privacy=True
)
from airouter import AiRouter, EmbeddingType
client = AiRouter(
api_key="<THE-API-KEY-YOU-GENERATED>"
)
model_name = client.get_best_model(
full_privacy=True,
embedding=<YOUR-EMBEDDING>,
embedding_type=EmbeddingType.TEXT_EMBEDDING_3_SMALL
)