# Provider Routing Source: https://ofox.ai/docs/develop/advanced/provider-routing A model is often served by more than one provider — `bytedance/seedance-2.0`, for example, comes from both `volcengine` and `byteplus`. ofox selects a provider automatically; `provider.type` pins the request to a specific one. ## Default routing behaviour When no `provider` field is sent, ofox distributes the request by weight across the channels currently serving that model. Which provider serves any single request is not predictable. ## Pinning a provider Pass the provider name in the `type` field. The field is located differently for each model type: | Model type | Field path | |------|------| | Chat models | `extra_body.provider.type` | | Video models | `provider.type` | **The Gemini native protocol ignores `extra_body.provider` in the body** — the request succeeds and the constraint simply does not apply, with no error. On that protocol use the `X-OfoxAI-Provider-Type` header instead. The per-protocol field contract is in [API · Provider routing](https://ofox.ai/docs/api/provider-routing). **Chat models** **cURL** ```bash filename="Terminal" curl https://api.ofox.ai/v1/chat/completions \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-5.5", "messages": [{ "role": "user", "content": "..." }], "extra_body": { "provider": { "type": "bedrock" } } }' ``` **Python** ```python filename="provider_routing.py" client.chat.completions.create( model="anthropic/claude-sonnet-5.5", messages=[{"role": "user", "content": "..."}], extra_body={"extra_body": {"provider": {"type": "bedrock"}}}, ) ``` **TypeScript** ```typescript filename="provider-routing.ts" await client.chat.completions.create({ model: 'anthropic/claude-sonnet-5.5', messages: [{ role: 'user', content: '...' }], extra_body: { provider: { type: 'bedrock' } }, } as any) ``` With the official OpenAI SDKs, `extra_body` must be present as a literal key in the request body. The TypeScript SDK sends it as written in the params object. The Python SDK's `extra_body=` argument merges its contents into the top level of the body, so the key must be nested one level deeper, or passed as a request header instead. **Video models** **cURL** ```bash filename="Terminal" curl https://api.ofox.ai/v1/videos \ -H "Authorization: Bearer $OFOX_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "bytedance/seedance-2.0-mini", "prompt": "...", "duration": 5, "provider": { "type": "byteplus" } }' ``` **Python** ```python filename="provider_routing_video.py" requests.post( "https://api.ofox.ai/v1/videos", headers={"Authorization": f"Bearer {OFOX_API_KEY}"}, json={ "model": "bytedance/seedance-2.0-mini", "prompt": "...", "duration": 5, "provider": {"type": "byteplus"}, }, ) ``` **TypeScript** ```typescript filename="provider-routing-video.ts" await fetch('https://api.ofox.ai/v1/videos', { method: 'POST', headers: { Authorization: `Bearer ${OFOX_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ model: 'bytedance/seedance-2.0-mini', prompt: '...', duration: 5, provider: { type: 'byteplus' }, }), }) ``` ## Available providers The providers currently supported by ofox are listed below. Short names, shown in parentheses, are equivalent to the full name; either may be used: | Provider | Description | |------|------| | `openai` | [OpenAI](https://openai.com):official API for the GPT family | | `anthropic` | [Anthropic](https://www.anthropic.com):official API for the Claude family | | `gemini` | [Google AI](https://ai.google.dev):official API for the Gemini family | | `azure_foundry` (`foundry`) | [Azure AI Foundry](https://azure.microsoft.com/products/ai-foundry):model hosting platform on Microsoft Azure | | `aws_bedrock` (`bedrock`) | [Amazon Bedrock](https://aws.amazon.com/bedrock/):model hosting service on AWS | | `google_vertex` (`vertex`) | [Vertex AI](https://cloud.google.com/vertex-ai):model hosting platform on Google Cloud | | `aliyun` | [Alibaba Cloud Bailian](https://www.aliyun.com/product/bailian):Alibaba Cloud's model service platform | | `alicloud` | [Alibaba Cloud Model Studio](https://www.alibabacloud.com/product/modelstudio):Alibaba Cloud's international model service platform | | `volcengine` | [Volcengine Ark](https://www.volcengine.com/product/ark):ByteDance's platform for mainland China | | `byteplus` | [BytePlus](https://www.byteplus.com):ByteDance's platform for markets outside mainland China | | `deepseek` | [DeepSeek](https://platform.deepseek.com):official API for the DeepSeek family | | `moonshot` | [Moonshot AI](https://platform.moonshot.cn):official API for the Kimi family | | `zhipu` | [Zhipu AI](https://open.bigmodel.cn):official API for the GLM family | | `zai` | [Z.ai](https://docs.z.ai):official API for the GLM family outside mainland China | | `minimax` | [MiniMax](https://platform.minimaxi.com):official API for the MiniMax family | | `grok` | [xAI](https://x.ai):official API for the Grok family | | `jina` | [Jina AI](https://jina.ai):embedding and rerank models | | `tencent` | [Tencent Cloud Hunyuan](https://cloud.tencent.com/product/hunyuan):Tencent Cloud's model service platform | Not every provider serves every model. Which providers serve a given model — and which protocols each of them supports — is shown on that model's page in the [model catalog](https://ofox.ai/models). The same data is available programmatically as `provider_cards[]` from `GET /v2/models/catalog/{provider}/{slug}?include=provider_price`. ### Chat models Chat models are spread across most of the providers above. The exact mapping and protocol support are given on each model's page. ### Video models The `bytedance/seedance-*` family is served by the two providers below, whose content policies differ: | Provider | Description | Content policy | |------|------|------| | `volcengine` | Volcengine Ark, ByteDance's platform for mainland China | Standard moderation | | `byteplus` | BytePlus, ByteDance's platform for markets outside mainland China | Allows not-for-all-audiences (NSFW) content | `byteplus` allows seedance to generate not-for-all-audiences (NSFW) content, while `volcengine` applies standard moderation. **`provider.type: "byteplus"` must be set explicitly when such content is required**; otherwise the weighted distribution may route the request to `volcengine`, where moderation will reject it. ## Common errors | `error.type` | Trigger | |------|------| | `invalid_provider_type` | The value is not in the provider enum: a misspelled name, or a retired spelling. | | `provider_type_unavailable` | The provider exists but does not serve this model. For chat models the error message also lists the providers that do. |