pub enum Routing {
OpenaiDirect,
AzureOpenai,
CustomBaseUrl,
AnthropicDirect,
AnthropicBedrock,
AnthropicVertex,
GoogleGenai,
GoogleGenerativeaiLegacy,
Unknown,
}Expand description
Where a client’s requests go, decided from its constructor and keyword
argument names. A provider’s model retirement date applies only to the
*_direct routes and Google’s own APIs.
Variants§
OpenaiDirect
OpenAI() / AsyncOpenAI() with no base_url, or the module-level API.
AzureOpenai
AzureOpenAI / AsyncAzureOpenAI, or openai.api_type = "azure".
CustomBaseUrl
A client given a base_url / api_base whose host is not the
provider’s own (OpenRouter, LiteLLM, a local server), or a
module-level openai.api_base / base_url set that way. A base_url
of api.openai.com or api.anthropic.com is direct.
AnthropicDirect
Anthropic() / AsyncAnthropic() with no base_url.
AnthropicBedrock
AnthropicBedrock / AsyncAnthropicBedrock.
AnthropicVertex
AnthropicVertex / AsyncAnthropicVertex.
GoogleGenai
google.genai.Client.
GoogleGenerativeaiLegacy
google.generativeai (the deprecated SDK).
Unknown
Not decided by this version: **kwargs passed to a direct
constructor, a client typed only by annotation, a binding assigned
more than one kind of client, a direct client given a base_url
after it is built or built in a file that sets OPENAI_BASE_URL /
ANTHROPIC_BASE_URL or writes the environment with a run-time name,
a base_url read from the environment with no fallback or one that
does not resolve to a string (each with an ambiguous_client gap at
each call), a non-literal or non-Azure
openai.api_type, or a hosted-platform client this list does not name
(BedrockOpenAI, OpenAI(provider=...), AnthropicAWS,
AnthropicFoundry, AnthropicGoogleCloud and their async variants).
The construction’s constructor field still names the class.