> ## Documentation Index
> Fetch the complete documentation index at: https://docs.z.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

<Tip>
  This guide will help you get started with [GLM Coding Plan](https://z.ai/subscribe?utm_source=zai\&utm_medium=link\&utm_term=quickstart\&utm_campaign=Platform_Ops&_channel_track_key=DRUfXN42) in minutes—from subscribing to using GLM models in officially [supported tools and products](https://docs.z.ai/devpack/tool/others#step-1-supported-tools).
</Tip>

<Warning>
  Using the GLM Coding Plan, you need to configure the dedicated Coding API `https://api.z.ai/api/coding/paas/v4` instead of the General API `https://api.z.ai/api/paas/v4`
</Warning>

## Getting Started

<Steps>
  <Step title="Register or Login">
    * Access [Z.AI Open Platform](https://z.ai/model-api), Register or Login.
          <img src="https://mintcdn.com/zhipu-32152247/tXQnmemMntMF1TeM/resource/quickstart-1.png?fit=max&auto=format&n=tXQnmemMntMF1TeM&q=85&s=a888ed8ef0db74f61a2c3ade2c9d5901" alt="description" width="1201" height="1011" data-path="resource/quickstart-1.png" />
  </Step>

  <Step title="Subscribe to GLM Coding Plan">
    After logging in, navigate to the [GLM Coding Plan](https://z.ai/subscribe?utm_source=zai\&utm_medium=link\&utm_term=quickstart\&utm_campaign=Platform_Ops&_channel_track_key=DRUfXN42) to select your preferred subscription plan.
    ![Description](https://cdn.bigmodel.cn/markdown/1776859780386image.png?attname=image.png)
  </Step>

  <Step title="Obtain API Key">
    After subscribing, navigate to your account dashboard and click [API Keys](https://z.ai/manage-apikey/apikey-list) to generate a new API Key.

    <img src="https://mintcdn.com/zhipu-32152247/tXQnmemMntMF1TeM/resource/quickstart-3.png?fit=max&auto=format&n=tXQnmemMntMF1TeM&q=85&s=65e4a2f900d7ace56ea241a2d0e12ab7" alt="description" width="2926" height="958" data-path="resource/quickstart-3.png" />

    <Warning>
      Safeguard your API Key by keeping it confidential and avoiding hard-coding it in your code. We recommend storing it in environment variables or configuration files.
    </Warning>
  </Step>

  <Step title="Select Coding Tool">
    The GLM Coding Plan is strictly limited to use within officially [supported tools and products](https://docs.z.ai/devpack/tool/others#step-1-supported-tools). Choose based on your preference:

    <CardGroup cols={3}>
      <Card title="Claude Code" color="#ffffff" href="https://docs.z.ai/devpack/tool/claude" />

      <Card title="Roo Code" color="#ffffff" href="https://docs.z.ai/devpack/tool/roo" />

      <Card title="Kilo Code" color="#ffffff" href="https://docs.z.ai/devpack/tool/kilo" />

      <Card title="Cline" color="#ffffff" href="https://docs.z.ai/devpack/tool/cline" />

      <Card title="OpenCode" color="#ffffff" href="https://docs.z.ai/devpack/tool/opencode" />

      <Card title="OpenClaw" color="#ffffff" href="https://docs.z.ai/devpack/tool/openclaw" />

      <Card title="Crush" color="#ffffff" href="https://docs.z.ai/devpack/tool/crush" />

      <Card title="Goose" color="#ffffff" href="https://docs.z.ai/devpack/tool/goose" />

      <Card title="Cursor" color="#ffffff" href="https://docs.z.ai/devpack/tool/cursor" />

      <Card title="Other Tools" color="#ffffff" href="https://docs.z.ai/devpack/tool/others" />
    </CardGroup>
  </Step>

  <Step title="Configuring Coding Tools">
    Using Claude Code as an example, configure the GLM model:

    <Tabs>
      <Tab title="Claude Code">
        **1. Install Claude Code**

        Prerequisite: You need to install [Node.js 18 or latest version](https://nodejs.org/en/download/)

        ```bash theme={null}
        # Open your terminal and install Claude Code
        npm install -g @anthropic-ai/claude-code

        # Create your working directory (e.g., `your-project`) and navigate to it using `cd`
        cd your-project

        # After installation, run `claude` to enter the Claude Code interactive interface
        claude
        ```

        **2. Configure Environment Variables**

        After installing Claude Code, set up environment variables using one of the following methods by enter the following commands in the **Mac OS terminal** or **Windows cmd**:

        <Tip>
          **Note**: When setting environment variables, the terminal will not return any output. This is normal, as long as no error message appears, the configuration has been applied successfully.
        </Tip>

        **Method 1: Automated Coding Tool Helper**

        Coding Tool Helper is a coding-tool companion that quickly loads **GLM Coding Plan** into your favorite **Coding Tools**. Install and run it, then follow the on-screen guidance to automatically install tools, configure plan, and manage MCP servers.

        ```bash theme={null}
        # Run Coding Tool Helper directly in the terminal
        npx @z_ai/coding-helper
        ```

        For more details, please refer to the [Coding Tool Helper](/devpack/extension/coding-tool-helper) documentation.

        **Method 2: Using a Script (Recommended for First-Time Users)**

        Just run the following command in your terminal. Attention only macOS Linux environment is supported, this method does not support Windows

        ```bash theme={null}
        curl -O "https://cdn.bigmodel.cn/install/claude_code_zai_env.sh" && bash ./claude_code_zai_env.sh
        ```

        **Method 3: Manual Configuration**

        If you have previously configured environment variables for Claude Code, you can manually configure them as follows. A new window is required for the changes to take effect.

        <CodeGroup>
          ```bash MacOS & Linux theme={null}
          # Edit the Claude Code configuration file `~/.claude/settings.json`
          # Add or modify the env fields ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN
          # Note to replace `your_zai_api_key` with the API Key you obtained in the previous step

          {
              "env": {
                  "ANTHROPIC_AUTH_TOKEN": "your_zai_api_key",
                  "ANTHROPIC_BASE_URL": "https://api.z.ai/api/anthropic",
                  "API_TIMEOUT_MS": "3000000"
              }
          }
          ```

          ```cmd Windows Cmd theme={null}
          # Run the following commands in Cmd
          # Note to replace `your_zai_api_key` with the API Key you obtained in the previous step

          setx ANTHROPIC_AUTH_TOKEN your_zai_api_key
          setx ANTHROPIC_BASE_URL https://api.z.ai/api/anthropic
          ```

          ```powershell Windows PowerShell theme={null}
          # Run the following commands in PowerShell
          # Note to replace `your_zai_api_key` with the API Key you obtained in the previous step

          [System.Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN', 'your_zai_api_key', 'User')
          [System.Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL', 'https://api.z.ai/api/anthropic', 'User')
          ```
        </CodeGroup>
      </Tab>

      <Tab title="Other Tools">
        **General Configuration Method**

        For other supported coding tools, configure as follows:

        * **API Provider**: Select OpenAI Compatible
        * **Base URL**: Enter `https://api.z.ai/api/paas/v4`
        * **API Key**: Enter your Z.AI API Key
        * **Model**: Select `GLM-4.7`

        Refer to each tool's detailed documentation for specific configuration steps.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Start Coding">
    Once configured, you can begin coding with GLM model!

    <Tabs>
      <Tab title="Natural Language Programming">
        ```bash theme={null}
        # Using Natural Language Commands in Claude Code
        Please create a React component containing a user login form
        ```

        GLM will automatically:

        * Analyze requirements and formulate an implementation plan
        * Generate complete React component code
        * Include form validation and styling
        * Ensure code runs directly
      </Tab>

      <Tab title="Code Debugging">
        ```bash theme={null}
        # Describe the Issue Encountered
        My API request returns a 404 error. Please help me check the code.
        ```

        GLM will automatically:

        * Analyze your codebase
        * Pinpoint potential causes of issues
        * Provide specific fixes
        * Explain the root causes
      </Tab>

      <Tab title="Code Optimization">
        ```bash theme={null}
        # Code Optimization
        This function performs poorly. Please optimize it for me.
        ```

        GLM will automatically:

        * Analyze performance bottlenecks in your code
        * Provide optimization suggestions and refactoring plans
        * Preserve existing functionality
        * Improve execution efficiency
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Feature Examples

<Card title="Smart Code Completion" icon="code">
  Generates real-time completion suggestions based on context, reducing manual input and significantly boosting development efficiency.

  ```javascript theme={null}
  // Type function name, GLM-4.7 auto-completes implementation
  function calculateTotal(items) {
      // GLM-4.7 automatically generates complete function implementation
  }
  ```
</Card>

<Card title="Code Repository Q&A" icon="circle-question">
  Ask questions about your team's codebase anytime to maintain a holistic understanding.

  ```
  Q: How is user authentication implemented in this project?
  A: GLM-4.7 analyzes your codebase and provides detailed explanations of the authentication process and related files.
  ```
</Card>

<Card title="Automated Task Management" icon="diagram-subtask">
  One-click fixes for lint issues, merge conflicts, and release note generation.

  ```
  # Auto-fix code style issues
  Fix all ESLint errors

  # Auto-generate documentation
  Generate detailed documentation for this API
  ```
</Card>

## Advanced Features

<AccordionGroup>
  <Accordion title="Vision MCP Server (Coding Plan Exclusive)">
    All users can utilize the Vision MCP Server, which employs the flagship vision reasoning model GLM-4.6V to comprehend and analyze image content.

    * Analyze UI design mockups and generate corresponding code
    * Understand flowcharts and architecture diagrams
    * Extract text and information from screenshots

    For detailed usage instructions, refer to the [Vision MCP Server](/devpack/mcp/vision-mcp-server) documentation.
  </Accordion>

  <Accordion title="Web Search MCP Server (Coding Plan Exclusive)">
    All users can utilize the Web Search MCP Server to access the latest technical information.

    * Search for the latest technical documentation and API changes
    * Obtain the latest information on open-source projects
    * Find solutions and best practices

    For detailed usage instructions, refer to the [Web Search MCP Server](/devpack/mcp/search-mcp-server) documentation.
  </Accordion>

  <Accordion title="Web Reader MCP Server (Coding Plan Exclusive)">
    All users can utilize the Web Reader MCP Server to fetch full webpage content and extract structured data.

    * Fetch complete webpage content including text, and links
    * Extract structured data such as title, body, and metadata
    * Remote HTTP-based MCP service, no local installation required

    For detailed usage instructions, refer to the [Web Reader MCP Server](/devpack/mcp/reader-mcp-server) documentation.
  </Accordion>
</AccordionGroup>
