Back to Eliza

Zai Plugin

packages/docs/plugin-registry/llm/zai.md

2.0.11.3 KB
Original Source

The Zai plugin connects Eliza agents to z.ai language models.

<Info> This plugin is available from the upstream elizaOS registry. It is **not bundled** in `plugins.json` and must be installed explicitly. </Info>

Package: @elizaos/plugin-zai

Installation

bash
eliza plugins install @elizaos/plugin-zai

Auto-Enable

The plugin auto-enables when ZAI_API_KEY is present. Legacy Z_AI_API_KEY is also accepted for existing installs:

bash
export ZAI_API_KEY=your-zai-api-key

Configuration

Environment VariableRequiredDescription
ZAI_API_KEYYesz.ai API key
Z_AI_API_KEYNoLegacy alias used only when ZAI_API_KEY is unset

eliza.json Example

json
{
  "auth": {
    "profiles": {
      "default": {
        "provider": "zai"
      }
    }
  }
}

Features

  • Text generation via z.ai models
  • OpenAI-compatible z.ai general API support
  • Keeps z.ai Coding Plan subscription endpoints separate from the direct API plugin