skillfed

zai-sdk

A SDK library for accessing big model apis from Z.ai

zai-sdk v0.2.3 119.6K downloads/30d#12,064 on PyPI
License unclear Active released

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 on this page — 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

zai-sdk on PyPI

pip

pip install zai-sdk

uv

uv add zai-sdk

poetry

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 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 6 — cachetools, httpx, pydantic, pydantic-core, pyjwt, sniffio
Maintenance actively maintained — 59 days since the last release
First released
Downloads 119,579/month — #12,064 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: zai_sdk-0.2.3-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

z.ai api clientlarge language model sdkchat completions apitext to video generationmultimodal ai apiembeddings vector generationspeech transcription sdk
llm-clientapi-wrappermultimodal

More Artificial Intelligence packages