Use Alibaba Cloud Model Studio models in Codex.
Quick Start
- 1
Open or create the configuration file
- macOS / Linux:
~/.codex/config.toml - Windows:
C:\Users\<username>\.codex\config.toml
- macOS / Linux:
- 2
Configure the model
To switch between models, see Configure model metadata.- Token Plan
- Pay-as-you-go
- Coding Plan
ReplaceOPENAI_API_KEYwith your Token Plan API Key:- Token Plan Personal Edition: Create or view API Key
- Token Plan Team Edition: Assign a seat and get the API Key
Copymodel_provider = "Token_Plan" model = "auto" [model_providers.Token_Plan] name = "Token_Plan" base_url = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1" env_key = "OPENAI_API_KEY" wire_api = "responses"ReplaceOPENAI_API_KEYwith your Alibaba Cloud Model Studio API Key, and replace{WorkspaceId}with your actual Workspace ID. The following example uses Singapore.Copymodel_provider = "Model_Studio" model = "qwen3.7-max" [model_providers.Model_Studio] name = "Model_Studio" base_url = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1" env_key = "OPENAI_API_KEY" wire_api = "responses"ReplaceOPENAI_API_KEYwith your Coding Plan API Key. Coding Plan uses the Chat Completions API and requires Codex 0.93.0 or an earlier version:Copynpm install -g @openai/codex@0.93.0Copymodel_provider = "Coding_Plan" model = "qwen3.7-plus" [model_providers.Coding_Plan] name = "Coding_Plan" base_url = "https://coding-intl.dashscope.aliyuncs.com/v1" env_key = "OPENAI_API_KEY" wire_api = "chat" - 3
Verify
Run the following command in your project directory:Copycodex exec "Hello"
Configure model metadata
Model metadata is used to switch between models in Codex. Without it, the model specified inconfig.toml still works, but Codex shows the Model metadata ... not found warning at startup and uses default metadata. After configuring it, switch models with codex -m or /model in the TUI.
- Token Plan Personal Edition
- Token Plan Team Edition
- Pay-as-you-go
Create Add the following to After configuring, specify a model with
~/.codex/model-catalog.local.json with the following content:Copy
{
"models": [
{
"slug": "auto",
"display_name": "auto",
"description": "DashScope model: auto",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 1,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen4-max",
"display_name": "qwen4-max",
"description": "DashScope model: qwen4-max",
"default_reasoning_level": "high",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "high",
"description": "Balances speed and reasoning depth"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 983616,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 2,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.8-max",
"display_name": "qwen3.8-max",
"description": "DashScope model: qwen3.8-max",
"default_reasoning_level": "xhigh",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 983616,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 3,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.8-flash",
"display_name": "qwen3.8-flash",
"description": "DashScope model: qwen3.8-flash",
"default_reasoning_level": "xhigh",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 983616,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 4,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.7-max",
"display_name": "qwen3.7-max",
"description": "DashScope model: qwen3.7-max",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 5,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.7-plus",
"display_name": "qwen3.7-plus",
"description": "DashScope model: qwen3.7-plus",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 6,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.6-flash",
"display_name": "qwen3.6-flash",
"description": "DashScope model: qwen3.6-flash",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 7,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "glm-5.3",
"display_name": "glm-5.3",
"description": "DashScope model: glm-5.3",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 8,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "glm-5.2",
"display_name": "glm-5.2",
"description": "DashScope model: glm-5.2",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 9,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4.1-flash",
"display_name": "deepseek-v4.1-flash",
"description": "DashScope model: deepseek-v4.1-flash",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 10,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4.1-flash-1017",
"display_name": "deepseek-v4.1-flash-1017",
"description": "DashScope model: deepseek-v4.1-flash-1017",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 11,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4-pro",
"display_name": "deepseek-v4-pro",
"description": "DashScope model: deepseek-v4-pro",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 12,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4-pro-0813",
"display_name": "deepseek-v4-pro-0813",
"description": "DashScope model: deepseek-v4-pro-0813",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 13,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4-flash-0731",
"display_name": "deepseek-v4-flash-0731",
"description": "DashScope model: deepseek-v4-flash-0731",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 14,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
}
]
}
~/.codex/config.toml:Copy
model_catalog_json = "~/.codex/model-catalog.local.json"
codex -m (for example, codex -m qwen3.8-flash), or enter /model in the TUI to switch between the configured models.Create Add the following to After configuring, specify a model with
~/.codex/model-catalog.local.json with the following content:Copy
{
"models": [
{
"slug": "auto",
"display_name": "auto",
"description": "DashScope model: auto",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 1,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen4-max",
"display_name": "qwen4-max",
"description": "DashScope model: qwen4-max",
"default_reasoning_level": "high",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "high",
"description": "Balances speed and reasoning depth"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 983616,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 2,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.8-max",
"display_name": "qwen3.8-max",
"description": "DashScope model: qwen3.8-max",
"default_reasoning_level": "xhigh",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 983616,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 3,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.8-flash",
"display_name": "qwen3.8-flash",
"description": "DashScope model: qwen3.8-flash",
"default_reasoning_level": "xhigh",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 983616,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 4,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.7-max",
"display_name": "qwen3.7-max",
"description": "DashScope model: qwen3.7-max",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 5,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.7-plus",
"display_name": "qwen3.7-plus",
"description": "DashScope model: qwen3.7-plus",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 6,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.6-flash",
"display_name": "qwen3.6-flash",
"description": "DashScope model: qwen3.6-flash",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 7,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "glm-5.3",
"display_name": "glm-5.3",
"description": "DashScope model: glm-5.3",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 8,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "glm-5.2",
"display_name": "glm-5.2",
"description": "DashScope model: glm-5.2",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 9,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4.1-flash",
"display_name": "deepseek-v4.1-flash",
"description": "DashScope model: deepseek-v4.1-flash",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 10,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4.1-flash-1017",
"display_name": "deepseek-v4.1-flash-1017",
"description": "DashScope model: deepseek-v4.1-flash-1017",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 11,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4-pro",
"display_name": "deepseek-v4-pro",
"description": "DashScope model: deepseek-v4-pro",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 12,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4-pro-0813",
"display_name": "deepseek-v4-pro-0813",
"description": "DashScope model: deepseek-v4-pro-0813",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 13,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4-flash-0731",
"display_name": "deepseek-v4-flash-0731",
"description": "DashScope model: deepseek-v4-flash-0731",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 14,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.6-plus",
"display_name": "qwen3.6-plus",
"description": "DashScope model: qwen3.6-plus",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 15,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "kimi-k2.7-code",
"display_name": "kimi-k2.7-code",
"description": "DashScope model: kimi-k2.7-code",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 262144,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 16,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "kimi-k2.6",
"display_name": "kimi-k2.6",
"description": "DashScope model: kimi-k2.6",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 262144,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 17,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "kimi-k2.5",
"display_name": "kimi-k2.5",
"description": "DashScope model: kimi-k2.5",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 262144,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 18,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "glm-5.1",
"display_name": "glm-5.1",
"description": "DashScope model: glm-5.1",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 202752,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 19,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "glm-5",
"display_name": "glm-5",
"description": "DashScope model: glm-5",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 202752,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 20,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "MiniMax-M2.5",
"display_name": "MiniMax-M2.5",
"description": "DashScope model: MiniMax-M2.5",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 204800,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 21,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
}
]
}
~/.codex/config.toml:Copy
model_catalog_json = "~/.codex/model-catalog.local.json"
codex -m (for example, codex -m qwen3.6-plus), or enter /model in the TUI to switch between the configured models.Create Add the following to After configuring, specify a model with
~/.codex/model-catalog.local.json with the following content:Copy
{
"models": [
{
"slug": "qwen3.8-max",
"display_name": "qwen3.8-max",
"description": "DashScope model: qwen3.8-max",
"default_reasoning_level": "xhigh",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 983616,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": true,
"input_modalities": [
"text",
"image"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 1,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "qwen3.7-max",
"display_name": "qwen3.7-max",
"description": "DashScope model: qwen3.7-max",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 2,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "deepseek-v4-pro",
"display_name": "deepseek-v4-pro",
"description": "DashScope model: deepseek-v4-pro",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 3,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
},
{
"slug": "glm-5.2",
"display_name": "glm-5.2",
"description": "DashScope model: glm-5.2",
"default_reasoning_level": "medium",
"supported_reasoning_levels": [
{
"effort": "low",
"description": "Fast responses with lighter reasoning"
},
{
"effort": "medium",
"description": "Balances speed and reasoning depth"
},
{
"effort": "high",
"description": "Greater reasoning depth for complex problems"
},
{
"effort": "xhigh",
"description": "Extra high reasoning depth for complex problems"
}
],
"context_window": 1000000,
"effective_context_window_percent": 95,
"supports_parallel_tool_calls": false,
"supports_image_detail_original": false,
"input_modalities": [
"text"
],
"shell_type": "default",
"visibility": "list",
"supported_in_api": true,
"priority": 4,
"base_instructions": "",
"support_verbosity": false,
"supports_reasoning_summaries": false,
"experimental_supported_tools": [],
"truncation_policy": {
"mode": "bytes",
"limit": 10000
}
}
]
}
~/.codex/config.toml:Copy
model_catalog_json = "~/.codex/model-catalog.local.json"
codex -m (for example, codex -m qwen3.8-max), or enter /model in the TUI to switch between the configured models.qwen4-max has a 1M-token context. The maximum output is 131,072 tokens in non-thinking mode and 262,144 tokens for thinking and the final answer combined. The defaults are reasoning_effort=high and thinking_budget=131072. Use
codex -m qwen4-max to select the model.Chat Completions configuration
Codex 0.94.0 and later support only the Responses API. If you use Codex 0.93.0 or an earlier version, or your model supports only Chat Completions, use the following configuration. For the configuration file path, see Quick Start.- Token Plan
- Pay-as-you-go
- Coding Plan
Replace
OPENAI_API_KEY with your Token Plan API Key:- Token Plan Personal Edition: Create or view API Key
- Token Plan Team Edition: Assign a seat and get the API Key
Copy
model_provider = "Token_Plan"
model = "auto"
[model_providers.Token_Plan]
name = "Token_Plan"
base_url = "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1"
env_key = "OPENAI_API_KEY"
wire_api = "chat"
Replace
OPENAI_API_KEY with your Alibaba Cloud Model Studio API Key, and replace {WorkspaceId} with your actual Workspace ID. The following example uses Singapore:Copy
model_provider = "Model_Studio"
model = "qwen3.8-max"
[model_providers.Model_Studio]
name = "Model_Studio"
base_url = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1"
env_key = "OPENAI_API_KEY"
wire_api = "chat"
Replace
OPENAI_API_KEY with your Coding Plan API Key.Copy
model_provider = "Coding_Plan"
model = "qwen3.7-plus"
[model_providers.Coding_Plan]
name = "Coding_Plan"
base_url = "https://coding-intl.dashscope.aliyuncs.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "chat"
Use CC Switch
CC Switch is a community open-source desktop GUI that switches between API Keys or billing plans.Add a provider
- 1In the CC Switch toolbar, select the Codex icon, click + to open Add provider, select the tab for your billing plan, fill in the configuration, and click Add.
- Token Plan
- Pay-as-you-go
- Coding Plan
- Provider name: Bailian-Token Plan
- API Key: Get from console
- Endpoint:
https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
- Provider name: Bailian-Pay-as-you-go
- API Key: Get from console
- Endpoint:
https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1
- Provider name: Bailian-Coding Plan
- API Key: Get from console
- Endpoint:
https://coding-intl.dashscope.aliyuncs.com/v1
- 2Expand Advanced options and enter a model from the supported models for your plan, such as
qwen3.8-max. - 3Click Enable next to the provider, then reopen the terminal and run
codexfor the configuration to take effect.
Error Codes
If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:- Token Plan: Personal Edition FAQ · Team Edition FAQ
- Pay-as-you-go: Error codes
- Coding Plan: Coding Plan FAQ
FAQ
What should I do if Codex shows the Model metadata ... not found warning at startup?
What should I do if Codex shows the Model metadata ... not found warning at startup?
Codex shows this warning when model metadata is not configured. It uses default metadata for the model, and calls are not affected. To switch between models, see Configure model metadata.
How do I use a savings plan with pay-as-you-go?
How do I use a savings plan with pay-as-you-go?
The pay-as-you-go setup remains the same: use your general Model Studio API key and Base URL. After you purchase a savings plan, it takes effect automatically and eligible usage is deducted automatically. See Savings plans.
What should I do if a third-party tool reports "domestic models not supported" or "check rejected / Bad request (400)"?
What should I do if a third-party tool reports "domestic models not supported" or "check rejected / Bad request (400)"?
Cause: Some third-party management tools (such as CC-Switch) send a health check or connection test probe when switching providers. The probe format differs from the request format Codex actually uses, so the Model Studio gateway may return 400 Bad request, and the tool reports "domestic models not supported". This message only indicates that the probe failed; it does not mean Model Studio lacks support for China (mainland) models, nor does it affect actual Codex usage.Solution: Configure Codex directly in
~/.codex/config.toml as described in Quick Start, without relying on the third-party tool's health check. After configuration, follow Verify to start Codex; a normal response means China (mainland) models are working. What should I do if I get a wire_api configuration error?
What should I do if I get a wire_api configuration error?
Cause: Codex 0.94.0 and later no longer support
wire_api = "chat". Depending on the version, you may see one of the following errors:wire_api = "chat" is no longer supportedunknown configuration field wire_api
- Error
wire_api = "chat" is no longer supported: Changewire_apitoresponsesand verifybase_url. - Error
unknown configuration field wire_api: Removewire_apifrom the corresponding provider section in~/.codex/config.toml. - To continue using Chat Completions, install Codex 0.93.0 or an earlier version (such as 0.80.0).
What should I do if I get the error unexpected status 401 Unauthorized?
What should I do if I get the error unexpected status 401 Unauthorized?
Cause:
- The API Key belongs to another plan (Token Plan, Coding Plan, and Pay-as-you-go keys are not interchangeable).
- The subscription has expired.
- The API Key was copied incorrectly (incomplete, extra spaces, or typo).
- Confirm that you are using the API Key for the selected plan.
- Check the plan management page for subscription expiration.
- Re-copy the API Key and make sure it is complete with no spaces.
- If the error persists, reset the API Key on the plan management page and configure the new key.
What should I do if I get the error unexpected status 404 Not Found?
What should I do if I get the error unexpected status 404 Not Found?
Cause:
base_url or wire_api in the configuration file is incorrect.Solution: Make sure base_url and wire_api match the configuration for your plan. See Quick Start. What should I do if I get the error "stream disconnected before completion: stream closed before response.completed"?
What should I do if I get the error "stream disconnected before completion: stream closed before response.completed"?
Cause: The streaming connection between Codex and the server closed before the response completed. Common causes:
- The conversation thread is too long and context compaction fails.
- The network is unstable and the SSE or WebSocket connection drops.
- The server is overloaded or rate limiting terminates the connection early.
- Start a new conversation thread to avoid excessive context accumulation.
- Check network stability. Disable VPN or proxy and retry.
- Wait and retry. Codex has a built-in retry mechanism that resolves most transient failures.
What should I do if I get a 429 rate limit or quota error?
What should I do if I get a 429 rate limit or quota error?
Cause: A 429 error has two common causes:
- Request rate limit (
429 Requests rate limit exceeded): too many requests in a short period. - Quota exhausted (
429 Allocated quota exceededorYour token-plan quota has been exhausted): the monthly Token Plan quota is used up.
- Request rate limit: wait one minute and reduce the request rate.
- Quota exhausted: wait for the next subscription month, purchase a usage package (quota automatically deducts from the package after the monthly quota is used up), or upgrade the plan. The reset time in the error message (such as
The quota will reset at HH:MM:SS UTC) is in UTC; add 8 hours to convert to Singapore time (CST).