A Python SDK for accessing large model APIs from Z.ai. Version 0.2.2 supports Python >=3.8. Provides clients for chatting, streaming, and embedding with multiple models. Early stage with frequent changes.
pip install zai-sdkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize client with API key from environment variable and make a chat completion.
Use pip install zai-sdk, then from zai import ZAI
Pass api_key to ZAI(api_key='your_key')
Use client.chat.completions.create(model=..., messages=...)