--- id: zai-sdk version: "0.2.3" license: unclear license_treatment: unclear maintenance: active --- # zai-sdk — A SDK library for accessing big model apis from Z.ai License: unclear · Maintenance: active · Downloads: 119.6K/mo ## What it is and what it does The zai-sdk is the official Python client library for Z.ai's large model open platform. It wraps Z.ai's REST APIs into a Python interface, letting developers call chat models, generate embeddings, create videos from text or images, transcribe audio, and manage conversations without building HTTP requests manually. The SDK handles authentication via API keys, supports both synchronous and asynchronous operations, and includes streaming for real-time responses. The package is built on httpx for HTTP transport, pydantic for request/response validation, and standard utilities like cachetools and pyjwt. It targets Python 3.8 and later across Windows, macOS, and Linux. Typical use cases include integrating Z.ai's GLM models into chatbots, building multimodal applications that process images, and batch-processing embeddings or video generation requests. Use it for: - Build a chatbot or conversational AI using Z.ai's GLM models with streaming responses. - Generate vector embeddings for text data to power semantic search or similarity matching. - Create videos programmatically from text prompts or images using the video generation API. - Transcribe audio files to text using Z.ai's speech recognition capabilities. - Implement tool-calling workflows where the model can invoke functions or web search during conversations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Official Python SDK for Z.ai's large model APIs, providing access to chat completions, embeddings, video generation, audio processing, and assistant features. Yes, if you are actively using Z.ai's platform. The SDK is actively maintained, has low install friction, and provides a clean Python interface to Z.ai's APIs. However, verify the license terms before use in proprietary projects, since the license status is currently unclear in the package metadata. ## Install pip install zai-sdk uv add zai-sdk poetry add zai-sdk ## Installing zai-sdk Before you install: Low install friction with a pure-Python wheel distribution. Active maintenance status with recent releases. Standard dependencies (httpx, pydantic, cachetools, pyjwt) are well-established. License in practice: License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before using in proprietary or restricted contexts. Quickstart: pip install zai-sdk from zai import ZaiClient client = ZaiClient(api_key="your-api-key") response = client.chat.completions.create( model="glm-5.2", messages=[{"role": "user", "content": "Hello"}] ) print(response.choices[0].message.content) Requires a valid Z.ai API key; obtain from https://docs.z.ai/ (overseas) or https://www.bigmodel.cn/ (mainland China). Verify before relying: - Actual license terms and restrictions—metadata shows no SPDX or raw license field - Whether all advertised features (video generation, audio transcription, web search) are available in all API tiers - Rate limits and quota policies for different model endpoints ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 119.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags z.ai api client, large language model sdk, chat completions api, text to video generation, multimodal ai api, embeddings vector generation, speech transcription sdk, llm-client, api-wrapper, multimodal [View on SkillFed](https://skillfed.io/packages/zai-sdk) · [View on PyPI](https://pypi.org/project/zai-sdk/)