What problem does it solve?
Vision-based chat enables applications to understand images and respond with natural language, bridging visual content and conversational AI for tasks like description, QA, and content understanding.
Core Features & Use Cases
- Vision-enabled conversations: analyze images and answer questions in a chat-like flow.
- Multimodal prompts: combine text with image inputs (image_url or base64) for richer interactions.
- Backend-first integration: build server-side services that describe, summarize, or reason about visual content in images.
Quick Start
To begin, initialize the z-ai SDK on the server and call the vision endpoint with a text prompt and an image. Example usage (no fences):
const zai = await ZAI.create();
const response = await zai.chat.completions.createVision({
messages: [
{
role: 'user',
content: [
{ type: 'text', text: 'Describe this image' },
{ type: 'image_url', image_url: { url: 'https://example.com/photo.jpg' } }
]
}
],
thinking: { type: 'disabled' }
});
console.log(response.choices?.[0]?.message?.content);