Skip to main content

Kilo CLI

Use Alibaba Cloud Model Studio models in Kilo CLI.

Quick Start

  1. 1

    Start Kilo CLI

    kilo
    
  2. 2

    Connect the provider

    Enter /connect, select the provider for your billing plan, and enter the API key:
    • Token Plan
    • Pay-as-you-go
    • Coding Plan
    Select Alibaba Token Plan (China) and enter the Token Plan API key for your edition:
  3. 3

    Select a model

    Enter /models and select the model you want.
  4. 4

    Verify

    kilo run "Hello"
    

Configure with a Configuration File

In addition to the options above, you can also connect using a configuration file.
  1. 1

    Open or create the configuration file

    • macOS / Linux: ~/.config/kilo/config.json
    • Windows: C:\Users\<username>\.config\kilo\config.json
  2. 2

    Add the configuration

    Replace YOUR_API_KEY with the API key for your plan, and add the configuration to config.json.
    • Token Plan Personal Edition
    • Token Plan Team Edition
    • Pay-as-you-go
    • Coding Plan
    {
      "$schema": "https://kilo.ai/config.json",
      "provider": {
        "bailian-token-plan": {
          "npm": "@ai-sdk/anthropic",
          "name": "Alibaba Cloud Model Studio",
          "options": {
            "baseURL": "https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic/v1",
            "apiKey": "YOUR_API_KEY"
          },
          "models": {
            "auto": {
              "name": "Auto",
              "modalities": {
                "input": [
                  "text"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "qwen4-max": {
              "name": "Qwen4 Max",
              "modalities": {
                "input": [
                  "text",
                  "image"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "qwen3.8-max": {
              "name": "Qwen3.8 Max",
              "modalities": {
                "input": [
                  "text",
                  "image"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "qwen3.8-flash": {
              "name": "Qwen3.8 Flash",
              "modalities": {
                "input": [
                  "text",
                  "image"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "qwen3.7-max": {
              "name": "Qwen3.7 Max",
              "modalities": {
                "input": [
                  "text"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "qwen3.7-plus": {
              "name": "Qwen3.7 Plus",
              "modalities": {
                "input": [
                  "text",
                  "image"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "qwen3.6-flash": {
              "name": "Qwen3.6 Flash",
              "modalities": {
                "input": [
                  "text",
                  "image"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "deepseek-v4.1-flash": {
              "name": "DeepSeek V4.1 Flash",
              "modalities": {
                "input": [
                  "text",
                  "image"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "deepseek-v4.1-flash-1017": {
              "name": "DeepSeek V4.1 Flash 1017",
              "modalities": {
                "input": [
                  "text",
                  "image"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "deepseek-v4-pro": {
              "name": "DeepSeek V4 Pro",
              "modalities": {
                "input": [
                  "text"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "deepseek-v4-pro-0813": {
              "name": "DeepSeek V4 Pro 0813",
              "modalities": {
                "input": [
                  "text"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "deepseek-v4-flash-0731": {
              "name": "DeepSeek V4 Flash 0731",
              "modalities": {
                "input": [
                  "text"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "glm-5.3": {
              "name": "GLM-5.3",
              "modalities": {
                "input": [
                  "text"
                ],
                "output": [
                  "text"
                ]
              }
            },
            "glm-5.2": {
              "name": "GLM-5.2",
              "modalities": {
                "input": [
                  "text"
                ],
                "output": [
                  "text"
                ]
              }
            }
          }
        }
      }
    }
    
    When using qwen4-max, the default single-request output limit is 32000. To allow longer output, set KILO_EXPERIMENTAL_OUTPUT_TOKEN_MAX; changing only limit.output does not raise the limit. 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.
  3. 3

    Verify

    After saving, run the following command:
    kilo run "Hello" -m <provider>/<model>
    
    Replace <provider>/<model> with the provider and model for your plan, such as bailian-token-plan/auto.

Error Codes

If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:

FAQ

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 or resource plan, it takes effect automatically and eligible usage is deducted automatically. See Savings plans and resource plans.
Add the model ID to models in config.json in the same format, save the file, and reopen Kilo CLI. For supported models, see the supported model list for your billing plan.
The API Key does not match the Base URL, or the key belongs to another billing plan. Confirm that the key type matches baseURL in the configuration, then save the configuration again.