{
  "version": "1.0.0",
  "httpserver": {
    "port": 5520,
    "host": "0.0.0.0"
  },
  "virtualrouter": {
    "providers": {
      "glm": {
        "id": "glm",
        "enabled": true,
        "type": "openai-standard",
        "baseURL": "https://open.bigmodel.cn/api/coding/paas/v4",
        "compatibilityProfile": "chat:glm",
        "models": {
      "glm-4.7": {
        "maxTokens": 128000,
        "maxContext": 202752,
        "supportsThinking": true,
        "supportsStreaming": true
      },
          "glm-4.6v": {
            "maxTokens": 128000,
            "maxContext": 200000,
            "supportsThinking": false,
            "supportsStreaming": true
          },
          "glm-4.5-air": {
            "supportsStreaming": true
          }
        },
        "auth": {
          "type": "apikey",
          "apiKey": "${GLM_API_KEY}"
        }
      },
      "qwen": {
        "id": "qwen",
        "enabled": true,
        "type": "openai",
        "baseURL": "https://portal.qwen.ai/v1",
        "compatibilityProfile": "chat:qwen",
        "auth": {
          "type": "qwen-oauth",
          "tokenFile": "default"
        },
        "models": {
          "qwen3-coder-plus": {
            "maxTokens": 64000,
            "maxContext": 1000000,
            "supportsStreaming": true
          },
          "qwen3.5-plus": {
            "maxContext": 1000000,
            "supportsStreaming": true
          }
        }
      },
      "kimi": {
        "id": "kimi",
        "enabled": true,
        "type": "openai",
        "baseURL": "https://api.kimi.com/coding/v1",
        "auth": {
          "type": "apikey",
          "apiKey": "${KIMI_API_KEY}"
        },
        "models": {
          "kimi-for-coding": {
            "supportsStreaming": true,
            "maxTokens": 64000,
            "maxContext": 256000
          }
        },
        "headers": {
          "User-Agent": "KimiCLI/1.0"
        }
      },
      "iflow": {
        "id": "iflow",
        "enabled": true,
        "type": "iflow",
        "baseURL": "https://apis.iflow.cn/v1",
        "compatibilityProfile": "chat:iflow",
        "auth": {
          "type": "iflow-cookie",
          "cookieFile": "~/.routecodex/auth/iflow-work.cookie"
        },
        "models": {
          "tstars2.0": {},
          "qwen3-coder-plus": {
            "maxContext": 1000000
          },
          "qwen3-coder": {},
          "qwen3-coder-next": {
            "maxContext": 262144
          },
          "qwen3-max": {},
          "qwen3-max-2026-01-23": {
            "maxContext": 262144
          },
          "qwen3-vl-plus": {},
          "qwen3-max-preview": {},
          "kimi-k2-0905": {},
          "glm-4.6": {},
          "glm-4.7": {
            "maxContext": 202752
          },
          "glm-5": {
            "maxContext": 202752
          },
          "kimi-k2": {},
          "kimi-k2.5": {
            "maxContext": 262144
          },
          "kimi-k2-thinking": {},
          "deepseek-v3.2": {},
          "deepseek-v3.1": {},
          "deepseek-r1": {},
          "deepseek-v3": {},
          "qwen3-32b": {},
          "qwen3-235b-a22b-thinking-2507": {},
          "qwen3-235b-a22b-instruct": {},
          "qwen3-235b": {},
          "minimax-m2": {},
          "minimax-m2.1": {},
          "minimax-m2.5": {
            "maxContext": 204800
          }
        }
      },
      "tab": {
        "id": "tab",
        "enabled": true,
        "type": "responses",
        "baseURL": "https://api.tabcode.cc/openai",
        "auth": {
          "type": "apikey",
          "apiKey": "${TAB_API_KEY}"
        },
        "models": {
          "gpt-5.1": {},
          "gpt-5.1-codex": {},
          "gpt-5.2-codex": {},
          "gpt-5.2": {}
        },
        "responses": {
          "process": "chat",
          "streaming": "always"
        },
        "config": {
          "responses": {
            "process": "chat",
            "streaming": "always"
          }
        }
      },
      "crs": {
        "id": "crs",
        "enabled": true,
        "type": "responses",
        "baseURL": "https://dapi.micosoft.icu/openai",
        "auth": {
          "type": "apikey",
          "apiKey": "${CRS_API_KEY}"
        },
        "models": {
          "gpt-5.1": {},
          "gpt-5.1-codex": {},
          "gpt-5.2-codex": {},
          "gpt-5.2": {}
        },
        "responses": {
          "process": "chat",
          "streaming": "always"
        },
        "config": {
          "responses": {
            "process": "chat",
            "streaming": "always"
          }
        }
      },
      "modelscope": {
        "id": "modelscope",
        "enabled": true,
        "type": "openai",
        "baseURL": "https://api-inference.modelscope.cn/v1",
        "auth": {
          "type": "apikey",
          "apiKey": "${MODELSCOPE_API_KEY}"
        },
        "models": {
          "deepseek-ai/DeepSeek-R1-0528": {
            "supportsStreaming": true,
            "maxTokens": 32000,
            "maxContext": 128000
          },
          "deepseek-ai/DeepSeek-V3.2-Exp": {
            "supportsStreaming": true,
            "maxTokens": 64000,
            "maxContext": 128000
          },
          "MiniMax/MiniMax-M2": {
            "supportsStreaming": true
          },
          "PaddlePaddle/ERNIE-4.5-300B-A47B-PT": {
            "supportsStreaming": true
          },
          "PaddlePaddle/ERNIE-4.5-VL-28B-A3B-PT": {
            "supportsStreaming": true
          },
          "Qwen/QVQ-72B-Preview": {
            "supportsStreaming": true
          },
          "Qwen/Qwen-Image-Edit": {
            "supportsStreaming": true
          },
          "Qwen/Qwen3-235B-A22B": {
            "supportsStreaming": true
          },
          "Qwen/Qwen3-235B-A22B-Instruct-2507": {
            "supportsStreaming": true,
            "maxTokens": 64000,
            "maxContext": 256000
          },
          "Qwen/Qwen3-235B-A22B-Thinking-2507": {
            "supportsStreaming": true,
            "maxTokens": 64000,
            "maxContext": 256000
          },
          "Qwen/Qwen3-Coder-480B-A35B-Instruct": {
            "supportsStreaming": true,
            "maxTokens": 64000,
            "maxContext": 256000
          },
          "Qwen/Qwen3-Next-80B-A3B-Instruct": {
            "supportsStreaming": true
          },
          "Qwen/Qwen3-Next-80B-A3B-Thinking": {
            "supportsStreaming": true
          },
          "Qwen/Qwen3-VL-235B-A22B-Instruct": {
            "supportsStreaming": true
          },
          "Qwen/QwQ-32B": {
            "supportsStreaming": true
          },
          "ZhipuAI/GLM-4.5": {
            "supportsStreaming": true
          },
          "ZhipuAI/GLM-4.6": {
            "supportsStreaming": true,
            "maxTokens": 128000,
            "maxContext": 200000,
            "supportsThinking": true
          }
        }
      },
      "lmstudio": {
        "id": "lmstudio",
        "enabled": true,
        "type": "responses",
        "baseURL": "http://127.0.0.1:1234/v1",
        "compatibilityProfile": "chat:lmstudio",
        "models": {
          "minimax-m2-mlx@4bit": {
            "supportsStreaming": true
          },
          "minimax-m2-mlx@8bit": {
            "supportsStreaming": true
          },
          "mradermacher/vibethinker-1.5b-gguf/._vibethinker-1.5b.q8_0.gguf": {
            "supportsStreaming": true
          },
          "mradermacher/vibethinker-1.5b-gguf/vibethinker-1.5b.q8_0.gguf": {
            "supportsStreaming": true
          },
          "aigotahole/sensenova-si-internvl3-8b-q5_k_m-gguf/._sensenova-si-internvl3-8b-q5_k_m.gguf": {
            "supportsStreaming": true
          },
          "aigotahole/sensenova-si-internvl3-8b-q5_k_m-gguf/sensenova-si-internvl3-8b-q5_k_m.gguf": {
            "supportsStreaming": true
          },
          "text-embedding-nomic-embed-text-v1.5": {
            "supportsStreaming": true
          },
          "mradermacher/ui-ins-32b-gguf/._ui-ins-32b.q4_k_s.gguf": {
            "supportsStreaming": true
          },
          "mradermacher/ui-ins-32b-gguf/ui-ins-32b.q4_k_s.gguf": {
            "supportsStreaming": true
          },
          "mradermacher/ui-ins-7b-gguf/._ui-ins-7b.q4_k_s.gguf": {
            "supportsStreaming": true
          },
          "mradermacher/ui-ins-7b-gguf/ui-ins-7b.q4_k_s.gguf": {
            "supportsStreaming": true
          },
          "kimi-linear-48b-a3b-instruct": {
            "supportsStreaming": true
          },
          "glm-4.6": {
            "maxTokens": 128000,
            "maxContext": 200000,
            "supportsThinking": true,
            "supportsStreaming": true
          },
          "quantstack/internvl3_5-gpt-oss-20b-a4b-preview-gguf/._internvl3_5-gpt-oss-20b-a4b-preview-q4_0.gguf": {
            "supportsStreaming": true
          },
          "quantstack/internvl3_5-gpt-oss-20b-a4b-preview-gguf/internvl3_5-gpt-oss-20b-a4b-preview-q4_0.gguf": {
            "supportsStreaming": true
          },
          "qwen3-next-80b-a3b-thinking": {
            "supportsStreaming": true
          },
          "gpt-oss-20b-mlx": {
            "supportsStreaming": true
          },
          "bge-small-en-v1.5": {
            "supportsStreaming": true
          }
        },
        "responses": {
          "process": "chat",
          "streaming": "always"
        },
        "auth": {
          "type": "apikey",
          "apiKey": ""
        },
        "config": {
          "responses": {
            "streaming": "always"
          }
        }
      },
      "mimo": {
        "id": "mimo",
        "enabled": true,
        "type": "openai-standard",
        "baseURL": "https://api.xiaomimimo.com/v1",
        "auth": {
          "type": "apikey",
          "apiKey": "${MIMO_API_KEY}"
        },
        "models": {
          "mimo-v2-flash": {
            "supportsStreaming": true
          }
        }
      }
    },
    "routing": {
      "default": [
        {
          "id": "default-primary",
          "priority": 200,
          "mode": "round-robin",
          "targets": ["glm.glm-4.7", "tab.gpt-5.2-codex"]
        },
        {
          "id": "default-backup",
          "priority": 100,
          "backup": true,
          "mode": "round-robin",
          "targets": ["iflow.kimi-k2"]
        }
      ],
      "coding": [
        {
          "id": "coding-primary",
          "mode": "priority",
          "targets": ["iflow.kimi-k2:200", "glm.glm-4.7:100"]
        }
      ],
      "longcontext": [
        {
          "id": "longcontext-primary",
          "mode": "priority",
          "targets": ["tab.gpt-5.1-codex:200", "crs.gpt-5.1:100"]
        }
      ],
      "thinking": [
        {
          "id": "thinking-primary",
          "mode": "priority",
          "targets": ["crs.gpt-5.1-codex:200", "tab.gpt-5.2-codex:100"]
        }
      ],
      "multimodal": [
        {
          "id": "multimodal-primary",
          "mode": "priority",
          "priority": 200,
          "targets": [
            "iflow.kimi-k2.5"
          ]
        },
        {
          "id": "multimodal-backup",
          "mode": "priority",
          "priority": 100,
          "backup": true,
          "targets": [
            "tab.gpt-5.2-codex"
          ]
        }
      ],
      "vision": [
        {
          "id": "vision-primary",
          "mode": "priority",
          "targets": [
            "glm.glm-4.6v",
            "iflow.qwen3-vl-plus",
            "glm.glm-4.7"
          ],
          "force": true
        }
      ],
      "search": [
        {
          "id": "search-primary",
          "mode": "priority",
          "targets": [
            "iflow.kimi-k2",
            "qwen.qwen3-coder-plus"
          ],
          "force": true
        }
      ],
      "background": [
        {
          "id": "background-primary",
          "mode": "round-robin",
          "targets": ["glm.glm-4.7", "qwen.qwen3-coder-plus"]
        }
      ],
      "tools": [
        {
          "id": "tools-primary",
          "mode": "priority",
          "targets": ["glm.glm-4.7:200", "qwen.qwen3-coder-plus:100", "iflow.kimi-k2:50"]
        }
      ]
    },
    "webSearch": {
      "engines": [
        {
          "id": "iflow:web_search",
          "providerKey": "iflow",
          "description": "iFlow Kimi K2 web search backend",
          "default": true,
          "searchEngineList": ["GOOGLE"]
        },
        {
          "id": "qwen",
          "providerKey": "qwen.qwen3-coder-plus",
          "description": "Qwen3 Coder Plus web search backend"
        }
      ],
      "injectPolicy": "selective",
      "force": true
    }
  }
}
