---
title: "Z.ai"
description: "Use Z.ai's GLM-family models from Autohand through an OpenAI-compatible provider configuration."
seo:
  title: "Z.ai Integration"
  description: "Configure Autohand Code CLI with Z.ai GLM models through an OpenAI-compatible API."
---

## What is the Autohand Z.ai integration? [#quick-answer]

The Autohand Z.ai integration connects the coding agent to GLM-family models through an OpenAI-compatible provider endpoint. It uses a Z.ai API key and a model identifier available to the account.

|  |  |
| --- | --- |
| Status | Available |
| Requires | A Z.ai API key and access to the selected GLM-family model. |
| Configure with | Put your key in `zai.apiKey` in `~/.autohand/config.json` (the CLI does not read `ZAI_API_KEY`), select the `zai` provider, and choose a model ID currently available to the Z.ai account. |
| Best for | Using GLM-family hosted models from Autohand. |

:::warning
**Know before you start:** Model IDs, context limits, regions, quotas, and API compatibility depend on the current Z.ai service and account.
:::

## Overview

Z.ai is available as the `zai` provider. It is useful for teams that want GLM-family models with straightforward API-key setup and model switching inside Autohand.

## Setup

```bash
# Save the key in ~/.autohand/config.json
autohand config set zai.apiKey "your-zai-api-key"

autohand --provider zai --model glm-5.2
```

## CLI configuration [#configuration]

```json
{
  "provider": "zai",
  "zai": {
    "apiKey": "your-zai-api-key",
    "baseUrl": "https://api.z.ai/api/paas/v4",
    "model": "glm-5.2"
  }
}
```

| Option | Description | Default |
| --- | --- | --- |
| `apiKey` | Your Z.ai API key | \- |
| `baseUrl` | Z.ai API endpoint | `https://api.z.ai/api/paas/v4` |
| `model` | GLM model ID | `glm-5.2` |

## Models

Use `/model` to select a Z.ai model or enter a custom model ID supported by your Z.ai account.

```bash
# Open the model picker (it takes no arguments)
/model

# Or choose a model for one run
autohand --model glm-5.2
```

**How do I configure the Autohand Z.ai integration?**

Put your key in `zai.apiKey` in `~/.autohand/config.json` (the CLI does not read `ZAI_API_KEY`), select the `zai` provider, and choose a model ID currently available to the Z.ai account.

**What does the Autohand Z.ai integration require?**

A Z.ai API key and access to the selected GLM-family model.

**What limitations should I know about?**

Model IDs, context limits, regions, quotas, and API compatibility depend on the current Z.ai service and account.
