Updated on 2026-07-08 GMT+08:00

Claude Code

During software development, developers often struggle with slow coding and complex debugging. Claude Code is an AI programming tool that helps developers write and debug code efficiently using large language models. However, quickly adding these advanced AI capabilities to existing development environments has become a new challenge. You can easily connect MaaS model APIs to Claude Code using simple settings to quickly integrate API capabilities and improve your development speed.

Prerequisites

You have subscribed to built-in services or created an endpoint. For details, see Subscribing to Built-in Services or Creating an Endpoint.

Billing

When using the MaaS service, you are charged based on the number of tokens used. For details, see Text Generation Models.

Constraints

This function is only supported in the CN-Hong Kong region.

Step 1: Install Claude Code

  1. Install Node.js 18 or later.
  2. Install Git for Windows (for Windows users only).
  3. Open the command-line interface and run the following command to install Claude Code:
    npm install -g @anthropic-ai/claude-code
  4. After the installation, run the following command to check whether the installation is successful:
    claude --version

    If the version number appears, the installation is successful.

Step 2: Configure MaaS Model APIs in Claude Code

After installing Claude Code, configure the following parameters:

Table 1 Parameter description

Parameter

Description

ANTHROPIC_BASE_URL

https://api-ap-southeast-1.modelarts-maas.com/anthropic

ANTHROPIC_AUTH_TOKEN

API Key

ANTHROPIC_MODEL

For details about the supported models and model parameter values, see supported models.

  1. Edit the settings.json file and update the following parameters.
    • <API_KEY>: Replace it with your own API key.
    • <Model_Name>: Replace it with the model to be used, for example, glm5. For details about supported models, see supported models.
      {
        "env": {
          "ANTHROPIC_AUTH_TOKEN": "<API_KEY>",
          "ANTHROPIC_BASE_URL": "https://api-ap-southeast-1.modelarts-maas.com/anthropic",
          "ANTHROPIC_MODEL": "<Model_Name>",
          "ANTHROPIC_DEFAULT_HAIKU_MODEL": "<Model_Name>",
          "ANTHROPIC_DEFAULT_SONNET_MODEL": "<Model_Name>",
          "ANTHROPIC_DEFAULT_OPUS_MODEL": "<Model_Name>"
        }
      }

    The configuration file path varies depending on your operating system. Run the command for your specific system. If the settings.json file does not exist, create it in the corresponding directory.

    • macOS/Linux: nano ~/.claude/settings.json
    • Windows: C:\Users\Your username\.claude\settings.json
  2. Save the configuration file and open a new terminal to apply the changes.

Step 3: Use Claude Code

  1. Start Claude Code.
    Open the terminal, navigate to the project directory, and run the claude command to start using Claude Code.
    claude

    Once it starts, trust the folder to let Claude Code access files in the directory.

  2. Run /status to verify the model status.
    Figure 1 Viewing the model status
  3. Start a conversation in Claude Code.
    Figure 2 Example conversation

Helpful Links