Home Tutorials Categories Skills About
ZH EN JA KO
Model Integration

Z.AI Model Integration Guide

· 5 min read

Z.AI Introduction

Z.AI is an emerging AI model service platform offering API access to multiple high-quality models. Its API is OpenAI-compatible, making integration with OpenClaw straightforward.

Get API Credentials

  1. Visit the Z.AI website and register
  2. Go to the developer console
  3. Create an API key
  4. Review available models and pricing

Basic Configuration

{
  "providers": {
    "zai": {
      "type": "openai",
      "baseUrl": "https://api.z.ai/v1",
      "apiKey": "{{ZAI_API_KEY}}",
      "models": ["zai-large", "zai-medium", "zai-fast"]
    }
  }
}
openclaw secrets set ZAI_API_KEY "zai-your-api-key"

Model Selection

Model Features Use Case
zai-large Strongest reasoning Complex tasks
zai-medium Balanced value General conversation
zai-fast Low latency Quick Q&A

Model Configuration

{
  "models": {
    "zai-smart": {
      "provider": "zai",
      "model": "zai-large",
      "temperature": 0.7,
      "maxTokens": 4096
    },
    "zai-quick": {
      "provider": "zai",
      "model": "zai-fast",
      "temperature": 0.5,
      "maxTokens": 2048
    }
  }
}

Advanced Parameters

{
  "models": {
    "zai-custom": {
      "provider": "zai",
      "model": "zai-large",
      "temperature": 0.6,
      "topP": 0.9,
      "frequencyPenalty": 0.3,
      "presencePenalty": 0.3,
      "maxTokens": 4096
    }
  }
}
  • frequencyPenalty: Reduces repetitive content
  • presencePenalty: Encourages diversity

Failover Configuration

Use Z.AI as a backup or primary provider with automatic failover to other providers when unavailable.

Connection Test

openclaw doctor --provider zai

Cost Management

{
  "providers": {
    "zai": {
      "costTracking": true,
      "dailyBudget": 15.00,
      "alertThreshold": 0.8
    }
  }
}

Summary

Z.AI provides another reliable model provider option for OpenClaw. With OpenAI-compatible APIs and simple configuration, it works well as part of a multi-provider strategy.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms