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
- Visit the Z.AI website and register
- Go to the developer console
- Create an API key
- 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 contentpresencePenalty: 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.