continue-custom/docs/customize/model-providers/more/zai.mdx
Dallin Romney a2c1fe6897
feat: model updates and + z.ai (#10638)
* Add latest model definitions across providers

Add new models for OpenAI (gpt-4.1, gpt-5.2, codex-mini, o1/o3/o4-mini),
Gemini (2.5 stable, 2.5-flash-lite, 3-flash-preview), Mistral (devstral,
magistral, ministral, mistral-nemo), xAI (grok-4-fast, grok-4-1-fast,
grok-3-fast), and Bedrock (Claude 4.5/4.6, Nova, Llama 4, DeepSeek).

Update tool support and reasoning detection for the new model families.

* Add Z.ai (GLM) provider, Kimi K2/K2.5 models, and fix OpenRouter tool support bug

- Add Z.ai as a new provider with GLM-5, GLM-4.7, GLM-4-plus, GLM-4.5 models
- Add Kimi K2 and K2.5 model packages to Moonshot provider
- Fix variable shadowing bug in OpenRouter tool support where loop
  variables shadowed the outer model parameter, causing specificModels
  and supportedContains checks to always return true
- Add moonshotai/kimi and zai-org/glm to OpenRouter supported prefixes
- Add Z.ai and Moonshot to docs navigation

* Clean up unnecessary import aliases for zAI

* Add Z.ai Coding Plan endpoint note to docs

* Replace placeholder zai.png icon with proper zAI.svg

* Add zAI provider to openai-adapters

* Fix Z.ai API key URL
2026-02-20 00:35:44 -08:00

59 lines
1.8 KiB
Text

---
title: "Z.ai"
description: "Configure Z.ai's GLM models with Continue, including GLM-5, GLM-4.7, and GLM-4.5"
---
[Z.ai](https://z.ai/) (formerly Zhipu AI) provides the GLM family of large language models with strong multilingual capabilities.
<Info>Get an API key from the [Z.ai Platform](https://z.ai/manage-apikey/apikey-list)</Info>
## Configuration
<Tabs>
<Tab title="YAML">
```yaml title="config.yaml"
name: My Config
version: 0.0.1
schema: v1
models:
- name: GLM-5
provider: zAI
model: glm-5
apiKey: <YOUR_ZAI_API_KEY>
```
</Tab>
<Tab title="JSON (Deprecated)">
```json title="config.json"
{
"models": [
{
"title": "GLM-5",
"provider": "zAI",
"model": "glm-5",
"apiKey": "<YOUR_ZAI_API_KEY>"
}
]
}
```
</Tab>
</Tabs>
## Available Models
- `glm-5`: Flagship model with 128K context window
- `glm-4.7`: Latest generation model with 128K context window
- `glm-4-plus`: Enhanced GLM-4 model with 128K context window
- `glm-4.5`: GLM-4.5 model with 128K context window
## Configuration Options
| Option | Description | Default |
| --------- | -------------------- | -------------------------------------- |
| `apiKey` | Z.ai API key | Required |
| `apiBase` | API base URL | `https://api.z.ai/api/paas/v4/` |
| `model` | Model name to use | `glm-5` |
<Tip>
Z.ai offers a dedicated [Coding Plan](https://docs.z.ai/api-reference/introduction) with a subscription-based endpoint optimized for coding tasks. To use it, set `apiBase` to `https://api.z.ai/api/coding/paas/v4/`. This endpoint uses prompt-based pricing rather than token-based pricing and may be more cost-effective for coding workflows.
</Tip>