Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ZAI_API_KEYYesYour Z.AI API key. Get it from https://z.ai/manage-apikey/apikey-list
ZAI_MAX_RETRIESNoMax retry attempts3
ZAI_RETRY_DELAYNoInitial retry delay in ms1000
ZAI_API_BASE_URLNoAPI base URLhttps://api.z.ai/api
ZAI_DEFAULT_SIZENoDefault image size1280x1280
ZAI_DEFAULT_MODELNoDefault modelglm-image
ZAI_REQUEST_TIMEOUTNoRequest timeout in ms60000

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_modelsA

List available Z.AI image generation models and their capabilities

generate_imageA

Generate an image synchronously from a text prompt. Returns the image URL directly. Use this for most image generation tasks.

generate_image_asyncA

Start an asynchronous image generation task. Returns a task ID to poll for results. Use this for long-running generations or when you need to process multiple images.

get_async_resultA

Retrieve the result of an asynchronous image generation task. Use the task ID from generate_image_async.

download_imageA

Download an image from a URL and return it as base64 or save to a file. Use this after generating an image to get the actual image data. Note: Z.AI image URLs expire after 30 days.

generate_and_download_imageA

Generate an image and automatically download it. This combines generate_image and download_image into a single operation. Returns the image as base64 or saves to a file. Best for when you want the image data immediately.

list_video_modelsA

List available Z.AI video generation models and their capabilities

generate_videoA

Generate a video asynchronously from text or images. Returns a task ID to poll for results. Supports multiple models: CogVideoX-3 (text/image/start-end frame), Vidu Q1 (1080P), Vidu 2 (720P, faster).

get_video_resultA

Retrieve the result of an asynchronous video generation task. Use the task ID from generate_video.

generate_and_download_videoA

Generate a video and automatically download it. Polls for completion and returns the video file. Best for when you want the video data immediately.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GeorgH93/z_ai_image_gen_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server