Z.ai

App · 14 actions

Use GLM to generate text, images, and video, transcribe audio, and extract or search web content.

Actions

ActionWhat it does
Count tokensCount tokens in Z.ai.
Generate imageGenerate image in Z.ai.
Generate textGenerate text in Z.ai.
Generate videoGenerate video in Z.ai.
Get agent conversationGet agent conversation in Z.ai.
Get agent resultGet agent result in Z.ai.
Get generationGet generation in Z.ai.
Parse documentParse document in Z.ai.
Read web pageRead web page in Z.ai.
Search webSearch web in Z.ai.
Start image generationStart image generation in Z.ai.
Transcribe audioTranscribe audio in Z.ai.
Translate textTranslate text in Z.ai.
Upload agent fileUpload agent file in Z.ai.

Count tokens

Count tokens in Z.ai.

Inputs

PromptprompttextRequired
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

PromptprompttextRequired
Prompt.
Qualityqualitytext
Quality.One of: hd, standard. Default: hd.
Image sizesizetext
Size.Default: 1280x1280.

Outputs

dataobject
Response value.
Example output
{
  "data": {
    "content_filter": [],
    "created": 1,
    "data": []
  }
}

Generate text

Generate text in Z.ai.

Inputs

ModelmodeltextRequired
Model.One of: glm-5.3, glm-5.2, glm-5.1, glm-5, glm-4.7, glm-4.6.
Reasoning effortreasoning_efforttext
Reasoning effort.One of: max, xhigh, high, medium, low, minimal, none. Default: max.
Temperaturetemperaturenumber
Temperature.From 0.0 to 1.0. Default: 1.0.
Top ptop_pnumber
Top p.From 0.01 to 1.0. Default: 0.95.
Max tokensmax_tokensnumber
Max tokens.From 1 to 131072.
PromptprompttextRequired
Enter the text to send to the model.
System instructionsystem_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

Promptprompttext
Prompt.
Qualityqualitytext
Quality.One of: speed, quality.
With audiowith_audiotrue/false
With audio.
Image URLimage_urllist
Image URL.
Sizesizetext
Size.One of: 1280x720, 720x1280, 1024x1024, 1920x1080, 1080x1920, 2048x1080, 3840x2160.
Fpsfpsnumber
Fps.One of: 30, 60.
Durationdurationnumber
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 IDagent_idtextRequired
Enter the agent ID used when starting the job or conversation.
Conversation IDconversation_idtextRequired
Conversation ID.
Custom variablescustom_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 IDagent_idtextRequired
Enter the agent ID used when starting the job or conversation.
Async IDasync_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 IDgeneration_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

FilefiletextRequired
File.
Return crop imagesreturn_crop_imagestrue/false
Return crop images.Default: false.
Need layout visualizationneed_layout_visualizationtrue/false
Need layout visualization.Default: false.
Start page IDstart_page_idnumber
Start page ID.At least 1.
End page IDend_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

URLurltextRequired
URL.
No cacheno_cachetrue/false
No cache.Default: false.
Return formatreturn_formattext
Return format.Default: markdown.
Retain imagesretain_imagestrue/false
Retain images.Default: true.
No gfmno_gfmtrue/false
No gfm.Default: false.
Keep img data URLkeep_img_data_urltrue/false
Keep img data URL.Default: false.
With images summarywith_images_summarytrue/false
With images summary.Default: false.
With links summarywith_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 querysearch_querytextRequired
Search query.
Countcountnumber
Count.From 1 to 50.
Search domain filtersearch_domain_filtertext
Search domain filter.
Search recency filtersearch_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

PromptprompttextRequired
Prompt.
Qualityqualitytext
Quality.One of: hd. Default: hd.
Image sizesizetext
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

FilefiletextRequired
Choose a workflow file or enter its public download URL.
Promptprompttext
Prompt.
Hotwordshotwordslist
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 translateprompttextRequired
Text to translate.
Target languagetarget_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

FilefiletextRequired
Choose a workflow file or enter its public download URL.
PurposepurposetextRequired
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"
  }
}

On this page