Provider routing
Set provider priority
Deciding where to call first
If the same model is connected to multiple suppliers, it’s possible to determine the order and conditions in which they are connected. The names of the suppliers are alibaba, anthropic, amazon-bedrock, azure, google-vertex.
If not specified, it will be called in the order determined by the model. For the Claude model, amazon-bedrock is called first. If there are any restrictions or obstacles, then anthropic will take over. Which supplier provided the response is indicated in the provider of the response.
client.chat.completions.create(
model="anthropic/claude-opus-5.5",
messages=[{"role": "user", "content": "Hello"}],
extra_body={"provider": {"order": ["amazon-bedrock"], "allow_fallbacks": False}},
)| Options | Value | What they do |
|---|---|---|
order | List of Names | First, we need to determine the order in which we will call the functions. |
only · ignore | List of Names | We determine where to insert or remove elements. This method is also used to assess the difficulty of automatic selection processes. |
allow_fallbacks | false | We won’t pass it on to another supplier. |
require_parameters | true | I only use those suppliers who know all the options that I have chosen. |
max_price | prompt, completion | If the price of 1 million tokens is more than this amount, then I won’t use it. If the input process takes longer, then I’ll compare it with a longer input price. |
sort | price | Call those suppliers who offer cheaper prices. Just add “:floor” after the model name. It works just the same. |
It’s possible to see which supplier a model is connected to, using the GET https://alprouter.com/api/v1/models/anthropic/claude-opus-5.5/endpoints field.
The deny and zdr of data_collection cannot be guaranteed yet. If you try to send them, an error will be reported. If there is no supplier that meets the requirements, then the no_endpoints error will occur.