Use Alibaba Cloud Model Studio in Codex

Prices and modelsEndpoint verified 2026-11-09

Generate a Codex config from the Responses-compatible endpoint in Alibaba Cloud Model Studio's docs. The API key in the config is a placeholder; replace it with a key you create at Alibaba Cloud Model Studio.

Endpoints

  • Plan only: Model Studio Token Plan Lite, Essential, Standard, Prohttps://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1Docs · verified 2026-11-09

Generate the config

Pick from the 8 models this provider sells, or type another model name.

Save to ~/.codex/config.toml; merge it in if the file already exists
model = "auto"
model_provider = "aliyun-bailian"

[model_providers.aliyun-bailian]
name = "Alibaba Cloud Model Studio"
base_url = "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"
env_key = "ALIYUN_BAILIAN_API_KEY"
wire_api = "responses"

Plans covered

  • Model Studio Token Plan Lite$5.85/mo equivalent每月限额 20,000 Credits;并发 Agent 1-2 个;同一实名认证主体限购一份
  • Model Studio Token Plan Essential$11.84/mo equivalent每月限额 45,000 Credits;并发 Agent 2-3 个;同一实名认证主体限购一份
  • Model Studio Token Plan Standard$20.84/mo equivalent每月限额 80,000 Credits;并发 Agent 3-4 个;赠送 Harness 权益;同一实名认证主体限购一份
  • Model Studio Token Plan Pro$46.77/mo equivalent每月限额 200,000 Credits;并发 Agent 6-8 个;赠送 Harness 权益;同一实名认证主体限购一份

How to check it works

Restart Codex and send a message. If it replies and the request shows up in Alibaba Cloud Model Studio's console, it is using this endpoint.

FAQ

Why is the key in an environment variable?

config.toml only holds the variable's name, so the key never goes into the config file and does not leak when you share or sync it. To keep it, add the export line to ~/.zshrc or ~/.bashrc.

How do I switch back to OpenAI?

Remove the model_provider line from config.toml, then restart Codex.

Does my key pass through this site?

No. The page only generates config text and never asks for your key; the key only goes into the terminal or environment variables on your own machine.

Codex configs for other providers