Expand description
Z.AI API clients and Rig integrations.
Z.AI exposes OpenAI-compatible APIs for both its general platform and coding-focused platform, plus an Anthropic-compatible endpoint for tools like Claude Code.
§OpenAI-compatible example
use rig::client::CompletionClient;
use rig::providers::zai;
let client = zai::Client::new("YOUR_API_KEY").expect("Failed to build client");
let glm_4_6 = client.completion_model(zai::GLM_4_6);§Anthropic-compatible example
use rig::client::CompletionClient;
use rig::providers::zai;
let client = zai::AnthropicClient::new("YOUR_API_KEY").expect("Failed to build client");
let glm_4_6 = client.completion_model(zai::GLM_4_6);Structs§
Constants§
- ANTHROPIC_
API_ BASE_ URL - Anthropic-compatible base URL.
- CODING_
API_ BASE_ URL - Coding-focused OpenAI-compatible base URL.
- GENERAL_
API_ BASE_ URL - General-purpose OpenAI-compatible base URL.
- GLM_4_5
glm-4.5- GLM_4_6
glm-4.6- GLM_
4_ 5V glm-4.5v- GLM_
4_ 5_ AIR glm-4.5-air- GLM_
4_ 5_ AIRX glm-4.5-airx- GLM_
4_ 6_ AIR glm-4.6-air- GLM_
4_ 6_ X glm-4.6-x