skillfed

zhipuai

A SDK library for accessing big model apis from ZhipuAI

zhipuai v2.1.5.20250825 342.9K downloads/30d#7,393 on PyPI
License unclear AGING released

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 zhipuai

uv

uv add zhipuai

poetry

poetry add zhipuai

Installing 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

Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

zhipuai api clientglm-4 python sdklarge language model api wrapperchat completion clientmultimodal ai apistreaming llm responseszhipu bigmodel sdk
llm-clientapi-wrapperstreaming

More Artificial Intelligence packages