zhipuai
A SDK library for accessing big model apis from ZhipuAI
What it is and what it does
This is the official Python SDK for ZhipuAI's large model API platform. It wraps HTTP calls to ZhipuAI's endpoints (chat completions, multimodal models, video generation, and assistants) behind a typed Python client interface. The SDK handles authentication via API keys, supports both standard and streaming responses, and includes connection pooling and token caching.
Developers use it to integrate ZhipuAI's models (like glm-4 and charglm-3) into Python applications without writing raw HTTP requests. It supports chat completions with tools, multimodal input (text and images), video generation, and character role-playing modes. The package requires Python 3.8+ and depends on httpx for HTTP transport and pydantic for request/response validation.
Use it for:
- Build a chatbot or conversational AI system using glm-4 or charglm-3 models with streaming responses.
- Integrate multimodal capabilities (text + image analysis) into an application via glm-4v.
- Generate videos from text prompts using the cogvideox-2 model for content creation workflows.
- Implement an assistant-based system with custom knowledge or tools via the assistant endpoint.
- Add web search or tool-calling capabilities to chat completions for real-time information retrieval.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Official Python SDK for ZhipuAI's large model APIs, providing type-safe client methods to call chat completions, multimodal models, video generation, and assistant endpoints.
Yes, if you are actively using ZhipuAI's APIs and need a typed Python client. The SDK is straightforward to install and use, with low dependency friction. However, the aging maintenance status (354 days since last release, no recent commits tracked) and unclear license are concerns—verify the license for your use case and monitor for upstream API changes that the SDK may not immediately reflect.
Install
zhipuai on PyPI
pip
pip install zhipuaiuv
uv add zhipuaipoetry
poetry add zhipuaiInstalling zhipuai
Before you install
Low install friction with five common dependencies (httpx, pydantic, cachetools, pyjwt, pydantic-core). Maintenance status is aging—no recent commits tracked and last release was 354 days ago, so expect slower response to issues or breaking upstream changes.
License in practice
License treatment 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 commercial projects.
Quickstart
pip install zhipuai
from zhipuai import ZhipuAI
client = ZhipuAI(api_key="your-api-key")
response = client.chat.completions.create(
model="glm-4",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)
Requires a valid ZhipuAI API key; set via api_key parameter or ZHIPUAI_API_KEY environment variable.
Verify before relying
- Whether the unclear license permits commercial or proprietary use without restriction.
- Current maintenance status and responsiveness to bug reports or security issues.
- Whether typing-extensions is truly optional or required despite not appearing in the runtime deps list.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (!=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,!=3.7.*,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — cachetools, httpx, pydantic, pydantic-core, pyjwt |
| Maintenance | aging — 354 days since the last release |
| First released | |
| Downloads | 342,875/month — #7,393 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zhipuai-2.1.5.20250825-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
zai-sdkOfficial Python SDK for Z.ai's large model…
unclear · top 15,000 on PyPI
ai21Python SDK for accessing AI21 Labs' language…
unclear · top 15,000 on PyPI
llama-api-clientProvides a typed Python client for the Llama…
permissive · top 15,000 on PyPI
vlmrunPython SDK for the VLM Run API platform,…
permissive · top 15,000 on PyPI
groqProvides a Python client library for accessing…
permissive · top 1,000 on PyPI
llama-index-llms-openaiIntegrates OpenAI's language models into…
permissive · top 1,000 on PyPI
writer-sdkPython client library for the Writer REST API,…
permissive · top 15,000 on PyPI
cerebras-cloud-sdkProvides a Python client library for accessing…
permissive · top 5,000 on PyPI
pydoOfficial Python client library for the…
permissive · top 15,000 on PyPI
pyimouapiAsync Python client for Imou Open Platform…
permissive · top 15,000 on PyPI