Z.ai
App · 14 actions
Use GLM to generate text, images, and video, transcribe audio, and extract or search web content.
Actions
| Action | What it does |
|---|---|
| Count tokens | Count tokens in Z.ai. |
| Generate image | Generate image in Z.ai. |
| Generate text | Generate text in Z.ai. |
| Generate video | Generate video in Z.ai. |
| Get agent conversation | Get agent conversation in Z.ai. |
| Get agent result | Get agent result in Z.ai. |
| Get generation | Get generation in Z.ai. |
| Parse document | Parse document in Z.ai. |
| Read web page | Read web page in Z.ai. |
| Search web | Search web in Z.ai. |
| Start image generation | Start image generation in Z.ai. |
| Transcribe audio | Transcribe audio in Z.ai. |
| Translate text | Translate text in Z.ai. |
| Upload agent file | Upload agent file in Z.ai. |
Count tokens
Count tokens in Z.ai.
Inputs
- Prompt
prompttextRequired - Enter the text to send to the model.
Outputs
dataobject- Response value.
Example output
{
"data": {
"created": 1,
"id": "example",
"request_id": "example",
"usage": {
"image_tokens": 1.0,
"prompt_tokens": 1.0,
"total_tokens": 1.0,
"video_tokens": 1.0
}
}
}Generate image
Generate image in Z.ai.
Inputs
- Prompt
prompttextRequired - Prompt.
- Quality
qualitytext - Quality.One of:
hd,standard. Default:hd. - Image size
sizetext - Size.Default:
1280x1280.
Outputs
dataobject- Response value.
Example output
{
"data": {
"content_filter": [],
"created": 1,
"data": []
}
}Generate text
Generate text in Z.ai.
Inputs
- Model
modeltextRequired - Model.One of:
glm-5.3,glm-5.2,glm-5.1,glm-5,glm-4.7,glm-4.6. - Reasoning effort
reasoning_efforttext - Reasoning effort.One of:
max,xhigh,high,medium,low,minimal,none. Default:max. - Temperature
temperaturenumber - Temperature.From 0.0 to 1.0. Default:
1.0. - Top p
top_pnumber - Top p.From 0.01 to 1.0. Default:
0.95. - Max tokens
max_tokensnumber - Max tokens.From 1 to 131072.
- Prompt
prompttextRequired - Enter the text to send to the model.
- System instruction
system_instructiontext - Give the model instructions for its reply.
Outputs
dataobject- Response value.
Example output
{
"data": {
"choices": [],
"created": 1,
"id": "example",
"model": "example",
"request_id": "example",
"usage": {
"completion_tokens": 1.0,
"prompt_tokens": 1.0,
"prompt_tokens_details": {
"cached_tokens": 1.0
},
"total_tokens": 1
},
"web_search": []
}
}Generate video
Generate video in Z.ai.
Inputs
- Prompt
prompttext - Prompt.
- Quality
qualitytext - Quality.One of:
speed,quality. - With audio
with_audiotrue/false - With audio.
- Image URL
image_urllist - Image URL.
- Size
sizetext - Size.One of:
1280x720,720x1280,1024x1024,1920x1080,1080x1920,2048x1080,3840x2160. - Fps
fpsnumber - Fps.One of:
30,60. - Duration
durationnumber - Duration.One of:
5,10.
Outputs
dataobject- Response value.
Example output
{
"data": {
"id": "example",
"model": "example",
"request_id": "example",
"task_status": "example"
}
}Get agent conversation
Get agent conversation in Z.ai.
Inputs
- Agent ID
agent_idtextRequired - Enter the agent ID used when starting the job or conversation.
- Conversation ID
conversation_idtextRequired - Conversation ID.
- Custom variables
custom_variablesobject - Custom variables.
Outputs
dataobject- Response value.
Example output
{
"data": {
"agent_id": "example",
"choices": [],
"conversation_id": "example",
"error": {
"code": "example",
"message": "example"
}
}
}Get agent result
Get agent result in Z.ai.
Inputs
- Agent ID
agent_idtextRequired - Enter the agent ID used when starting the job or conversation.
- Async ID
async_idtextRequired - Async ID.
Outputs
dataobject- Response value.
Example output
{
"data": {
"agent_id": "example",
"async_id": "example",
"choices": [],
"status": "example"
}
}Get generation
Get generation in Z.ai.
Inputs
- Generation ID
generation_idtextRequired - Generation ID.
Outputs
dataobject- Video Generation
Example output
{
"data": {
"image_result": [],
"model": "example",
"request_id": "example",
"task_status": "example",
"video_result": []
}
}Parse document
Parse document in Z.ai.
Inputs
- File
filetextRequired - File.
- Return crop images
return_crop_imagestrue/false - Return crop images.Default:
false. - Need layout visualization
need_layout_visualizationtrue/false - Need layout visualization.Default:
false. - Start page ID
start_page_idnumber - Start page ID.At least 1.
- End page ID
end_page_idnumber - End page ID.At least 1.
Outputs
dataobject- Response value.
Example output
{
"data": {
"created": 1,
"data_info": {
"num_pages": 1,
"pages": []
},
"id": "example",
"layout_details": [],
"layout_visualization": [],
"md_results": "example",
"model": "example",
"request_id": "example",
"usage": {
"completion_tokens": 1.0,
"prompt_tokens": 1.0,
"prompt_tokens_details": {
"cached_tokens": 1.0
},
"total_tokens": 1
}
}
}Read web page
Read web page in Z.ai.
Inputs
- URL
urltextRequired - URL.
- No cache
no_cachetrue/false - No cache.Default:
false. - Return format
return_formattext - Return format.Default:
markdown. - Retain images
retain_imagestrue/false - Retain images.Default:
true. - No gfm
no_gfmtrue/false - No gfm.Default:
false. - Keep img data URL
keep_img_data_urltrue/false - Keep img data URL.Default:
false. - With images summary
with_images_summarytrue/false - With images summary.Default:
false. - With links summary
with_links_summarytrue/false - With links summary.Default:
false.
Outputs
dataobject- Response value.
Example output
{
"data": {
"created": 1,
"id": "example",
"model": "example",
"reader_result": {
"content": "example",
"description": "example",
"external": {
"stylesheet": {}
},
"metadata": {
"description": "example",
"format-detection": "example",
"keywords": "example",
"viewport": "example"
},
"title": "example",
"url": "example"
},
"request_id": "example"
}
}Search web
Search web in Z.ai.
Inputs
- Search query
search_querytextRequired - Search query.
- Count
countnumber - Count.From 1 to 50.
- Search domain filter
search_domain_filtertext - Search domain filter.
- Search recency filter
search_recency_filtertext - Search recency filter.One of:
oneDay,oneWeek,oneMonth,oneYear,noLimit.
Outputs
dataobject- Response value.
Example output
{
"data": {
"created": 1,
"id": "example",
"search_result": []
}
}Start image generation
Start image generation in Z.ai.
Inputs
- Prompt
prompttextRequired - Prompt.
- Quality
qualitytext - Quality.One of:
hd. Default:hd. - Image size
sizetext - Size.Default:
1280x1280.
Outputs
dataobject- Response value.
Example output
{
"data": {
"id": "example",
"model": "example",
"request_id": "example",
"task_status": "example"
}
}Transcribe audio
Transcribe audio in Z.ai.
Inputs
- File
filetextRequired - Choose a workflow file or enter its public download URL.
- Prompt
prompttext - Prompt.
- Hotwords
hotwordslist - Hotwords.
Outputs
dataobject- Response value.
Example output
{
"data": {
"created": 1,
"id": "example",
"model": "example",
"request_id": "example",
"text": "example"
}
}Translate text
Translate text in Z.ai.
Inputs
- Text to translate
prompttextRequired - Text to translate.
- Target language
target_languagetextRequired - Choose the language for the translation.One of:
zh-CN,zh-TW,wyw,yue,en,en-GB,en-US,ja,ko,fr, and 32 more.
Outputs
dataobject- General Translation
Example output
{
"data": {
"agent_id": "example",
"choices": [],
"id": "example",
"status": "example",
"usage": {
"completion_tokens": 1,
"prompt_tokens": 1,
"total_calls": 1,
"total_tokens": 1
}
}
}Upload agent file
Upload agent file in Z.ai.
Inputs
- File
filetextRequired - Choose a workflow file or enter its public download URL.
- Purpose
purposetextRequired - Purpose.One of:
user_data(User data),agent.
Outputs
dataobject- Response value.
Example output
{
"data": {
"bytes": 1,
"created_at": 1,
"filename": "example",
"id": "example",
"object": "example",
"purpose": "example"
}
}