Updated on 2026-08-06 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

The following sections describe detailed configuration instructions.

  1. Once Claude Code is installed, navigate to the Claude Code configuration directory (C:\Users\<your-username>\.claude\) and locate settings.json. If the file does not exist, create a new, empty settings.json file in that directory.
  2. Edit the settings.json file. If you created a new empty file, copy the configuration below into settings.json:
    • <API_KEY>: Replace with your actual API key. If you do not have one, generate it on the API Key Management page.
    • <Model_Name>: Replace it with the model to be used, for example, glm-5.2. 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>"
        }
      }

      Example

      Figure 1 Configuration example

  3. Save the configuration file and open a new terminal to apply the changes.
  1. Once Claude Code is installed, navigate to the Claude Code configuration directory (~/.claude/) and locate settings.json. If the file does not exist, create a new, empty settings.json file in that directory.
  2. Edit the settings.json file. If you created a new empty file, copy the configuration below into settings.json and then edit it.
    Edit the settings.json file:
    nano ~/.claude/settings.json
    • <API_KEY>: Replace with your actual API key. If you do not have one, generate it on the API Key Management page.
    • <Model_Name>: Replace it with the model to be used, for example, glm-5.2. 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>"
        }
      }

      Example

      Figure 2 Configuration example

  3. 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. The following figure shows an example.

  2. Run /status to verify the model status.
    Figure 3 Viewing the model status

  3. Start a conversation in Claude Code.
    Figure 4 Example conversation

Helpful Links