Packages
req_llm
1.2.0
1.28.0
1.27.0
1.26.0
1.25.0
1.24.0
1.23.0
1.22.0
1.21.1
1.21.0
1.20.0
1.19.0
1.18.0
1.17.1
1.17.0
1.16.0
1.15.0
1.14.0
1.13.0
1.12.0
1.11.0
1.10.0
1.9.0
1.8.0
1.7.1
1.7.0
1.6.0
1.5.1
1.5.0
1.4.1
1.4.0
1.3.0
1.2.0
1.1.0
1.0.0
1.0.0-rc.8
1.0.0-rc.7
1.0.0-rc.6
1.0.0-rc.5
1.0.0-rc.4
1.0.0-rc.3
1.0.0-rc.2
1.0.0-rc.1
Composable Elixir library for LLM interactions built on Req & Finch
Current section
Files
Jump to
Current section
Files
guides/zai.md
# Z.AI
OpenAI-compatible API for Z.AI GLM models (Standard Endpoint).
## Configuration
```bash
ZAI_API_KEY=your-api-key
```
## Provider Options
No custom provider options - uses OpenAI-compatible defaults.
Passed via standard ReqLLM options:
- `temperature`, `max_tokens`, `top_p`
- `tools` for function calling
- Standard context and streaming
## Supported Models
- **glm-4.5** - Advanced reasoning model with 131K context
- **glm-4.5-air** - Lighter variant with same capabilities
- **glm-4.5-flash** - Free tier model with fast inference
- **glm-4.5v** - Vision model supporting text, image, and video inputs
- **glm-4.6** - Latest model with 204K context and improved reasoning
## Standard vs Coder Endpoints
This provider uses Z.AI's **standard endpoint** (`/api/paas/v4`) for general-purpose chat and reasoning tasks.
For code generation optimized responses, use the [Z.AI Coder Provider](zai_coder.md).
## Implementation Notes
- Extended timeout for thinking mode (300s)
- Full OpenAI compatibility
- Automatic thinking mode detection and timeout adjustment
## Resources
- [Z.AI Documentation](https://z.ai/docs)