---
title: "[已淘汰] 依團隊路由"
url: "/docs/proxy/team_based_routing"
canonical_url: "https://docs.litellm.ai/docs/proxy/team_based_routing"
type: "docs"
last_updated: "2026-10-08"
related:
  - "/docs/rules"
  - "/docs/proxy/customer_routing"
---
# [已淘汰] 依團隊路由

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt


:::info

此功能已淘汰，請改用 [依標籤路由](./tag_routing.md)

:::

## 路由 {#routing}
根據 team-id 將呼叫路由到不同的模型群組

### 依模型群組的設定  {#config-with-model-group}

建立一個包含 2 個模型群組加上已連線的 postgres db 的 config.yaml

```yaml
model_list: 
  - model_name: gpt-4o-mini-eu # 👈 Model Group 1
    litellm_params:
      model: azure/chatgpt-v-2
      api_base: os.environ/AZURE_API_BASE_EU
      api_key: os.environ/AZURE_API_KEY_EU
      api_version: "2023-07-01-preview"
  - model_name: gpt-4o-mini-worldwide # 👈 Model Group 2
    litellm_params:
      model: azure/chatgpt-v-2
      api_base: os.environ/AZURE_API_BASE
      api_key: os.environ/AZURE_API_KEY
      api_version: "2023-07-01-preview"

general_settings: 
    master_key: os.environ/LITELLM_MASTER_KEY
    database_url: "postgresql://..." # 👈 Connect proxy to DB
```

啟動 proxy

```bash
litellm --config /path/to/config.yaml
```

### 使用模型別名建立團隊 {#create-team-with-model-alias}

```bash
# Authorization: 👈 Master Key
curl --location 'http://0.0.0.0:4000/team/new' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
  "team_alias": "my-new-team_4",
  "model_aliases": {"gpt-5.6-luna": "gpt-4o-mini-eu"}
}'

# Returns team_id: my-team-id
```

### 建立團隊金鑰  {#create-team-key}

```bash 
curl --location 'http://localhost:4000/key/generate' \
--header "Authorization: Bearer $LITELLM_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
    "team_id": "my-team-id",  # 👈 YOUR TEAM ID
}'
```

### 使用別名呼叫模型  {#call-model-with-alias}

```bash
curl --location 'http://0.0.0.0:4000/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk-A1L0C3Px2LJl53sF_kTF9A' \
--data '{
  "model": "gpt-5.6-luna", # 👈 MODEL 
  "messages": [{"role": "system", "content": "You'\''re an expert at writing poems"}, {"role": "user", "content": "Write me a poem"}, {"role": "user", "content": "What'\''s your name?"}],
  "user": "usha"
}'
```

## Related pages

- [規則](https://docs.litellm.ai/docs/rules.md)
- [[已棄用] 基於區域的路由](https://docs.litellm.ai/docs/proxy/customer_routing.md)
