Z.AI
Professional-grade AI models with native multimodal support including text, images, videos, and documents.
Overview
Z.AI provides professional-grade AI models with native multimodal capabilities. Through Yunxin, Z.AI models are accessed via the Chat Completions API format.
Official Website: https://docs.z.ai
Key Features
- Multimodal Input — Native support for text, images (
image_url), videos (video_url), and documents (file_url) - Thinking/Reasoning — Extended reasoning support via
thinkingparameter - Function Calling — Full tool use support
- Structured Output — JSON and structured responses via
response_format - Streaming — Server-sent events for real-time responses
Usage Example
from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://api.yuhuanstudio.com/v1"
)
response = client.chat.completions.create(
model="model-id",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)Multimodal Content
Z.AI natively supports multiple content types in the Chat Completions format:
Images
{
"type": "image_url",
"image_url": {"url": "https://example.com/photo.jpg"}
}Documents
{
"type": "file_url",
"file_url": {"url": "https://example.com/document.pdf"}
}Videos
{
"type": "video_url",
"video_url": {"url": "https://example.com/video.mp4"}
}Thinking/Reasoning
Enable extended reasoning for complex tasks:
response = client.chat.completions.create(
model="model-id",
messages=[{"role": "user", "content": "Solve this complex problem..."}],
extra_body={"thinking": {"type": "enabled"}}
)Function Calling
response = client.chat.completions.create(
model="model-id",
messages=[{"role": "user", "content": "What's the weather?"}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather",
"parameters": {
"type": "object",
"properties": {"location": {"type": "string"}},
"required": ["location"]
}
}
}]
)Available Models
Use the Models API to query available models:
curl https://api.yuhuanstudio.com/v1/models?provider=zai \
-H "Authorization: Bearer YOUR_API_KEY"Models and pricing are synced automatically. Check the dashboard for current availability and rates.
Official Resources
How is this guide?