Create more. Sell more this Black Friday.Explore
Skip to article
Blue glass conduits branch from a brushed-metal gateway
Tutorial

Where to Use GLM-5.4: Platforms, API Pricing, and Local Setup

Use GLM-5.4 on EvoLink with model ID glm-5.4, an EvoLink API key, and a Chat Completions request. See runnable examples, supported inputs, and other access options.

Himi LiProduct Manager at EvoLink
11 min read
GLM-5.4 is available on EvoLink. Call glm-5.4 with your EvoLink API key to send text, images, video, or files and get a text response. GLM-5.4 on EvoLink · Get an API key
  • For apps, scripts, and model comparisons — Use EvoLink’s unified API. You can compare a visual coding task with GLM-5.3 Flash using the same key and endpoint.
  • For coding inside an editor — Select GLM-5.4 in ZCode or a compatible tool covered by your GLM Coding Plan.
  • For a quick browser test or direct API access — Try the model picker in Z.ai Chat. For a direct application integration, use the standard API from Z.ai or BigModel. ZCode setup · Z.ai Chat · Z.ai model guide
Three illustrative entry points: browser chat, a coding editor, and an API terminal
Three illustrative entry points: browser chat, a coding editor, and an API terminal
Pick the entry point by what you need to keep. Use chat to explore one prompt, an editor to inspect a proposed repository diff, or the API to save usage and repeat the same test.

Platforms and ways to access the model

Public reference rates checked December 2, 2026. API rates below are per million tokens. EvoLink model rates
PlatformAccessPublic reference priceBest for
EvoLinkUnified API with model ID glm-5.4. Chat Completions, Responses, and Anthropic Messages.Pay as you go for input, cached input, and output. Current ratesAdding GLM-5.4 to an app or comparing models with one key.
ZCode and compatible editorsGLM Coding Plan. ZCode also documents a Start Plan for eligible new users.Subscription quota or a limited trial, depending on your account.Coding directly in an editor or terminal tool.
Z.ai ChatBrowser chat. Check the model picker in your signed-in account.Account limits are shown in the product.Trying a prompt before setting up an API.
Z.ai international APIStandard API with model ID glm-5.4.$1.40 input, $0.26 cached input, $4.40 outputIntegrating directly with Z.ai and paying in USD.
BigModel API in ChinaStandard API with model ID glm-5.4.¥8 input, ¥2 cached input, ¥28 outputIntegrating directly with BigModel and paying in CNY.
To call GLM-5.4 on EvoLink, send POST https://direct.evolink.ai/v1/chat/completions with model: "glm-5.4" and an EvoLink API key in the Bearer header. Use messages for the prompt. If you already call GLM-5.3 through EvoLink, keep the same key and Chat Completions client, and change the model ID. EvoLink GLM quickstart · Full Chat Completions reference
SettingValue to use
API keySign in, create or reuse a key in API Keys, and check your available balance. Store the key as EVOLINK_API_KEY in your local shell or server secrets.
SDK base URLhttps://direct.evolink.ai/v1. Enter the base URL in your OpenAI-compatible SDK; it appends /chat/completions.
HTTP endpointPOST https://direct.evolink.ai/v1/chat/completions. EvoLink also documents https://api.evolink.ai as an alternative host and the primary host for multimodal services. The request path stays the same.
Request headersAuthorization: Bearer YOUR_EVOLINK_API_KEY and Content-Type: application/json. Keep keys in the backend or local environment.
Required bodymodel is glm-5.4. messages contains at least one user message. A plain-text request can put a string in messages[0].content.

Make the first text request

Set EVOLINK_API_KEY before running this example with curl and jq. It saves the request, response headers, and JSON response. A successful smoke test returns HTTP 200 and a nonempty assistant answer, ideally READY.
cat > glm-text-request.json <<'JSON'
{
  "model": "glm-5.4",
  "messages": [{"role": "user", "content": "Reply with exactly READY."}],
  "reasoning_effort": "low",
  "max_tokens": 1024,
  "stream": false
}
JSON

curl --silent --show-error --fail-with-body \
  https://direct.evolink.ai/v1/chat/completions \
  -H "Authorization: Bearer ${EVOLINK_API_KEY:?Set EVOLINK_API_KEY}" \
  -H "Content-Type: application/json" \
  --data-binary @glm-text-request.json \
  --dump-header glm-response-headers.txt \
  --output glm-text-response.json &&
jq '{model, answer: .choices[0].message.content, finish_reason: .choices[0].finish_reason, usage}' glm-text-response.json
View GLM-5.4 on EvoLink

The model page shows current rates and supported API formats. Use the examples below to integrate the route into an application or an Agent.

Read the answer, usage, and request ID

FieldWhat to do with it
choices[0].message.contentRead the final user-facing text. If you enable function tools, handle message.tool_calls when present, then send back your tool result with its matching call ID.
choices[0].finish_reasonstop is a normal finish. If you see length or the response uses all its tokens on reasoning, reduce the task or raise max_tokens.
usage.prompt_tokensInput tokens, including any image, video frames, or PDF content processed in the request.
usage.prompt_tokens_details.cached_tokensCached input tokens when reported. These are part of input usage.
usage.completion_tokensOutput tokens, including reasoning. usage.completion_tokens_details.reasoning_tokens, when present, is a breakdown of that total.
X-Request-Id response headerSave the gateway request ID for investigating errors and looking up the actual charge.
GLM-5.4 always reasons. On Chat Completions, choose low, high, or max with reasoning_effort. Omitting it uses max. thinking.type: "disabled" leaves reasoning enabled, and none maps to low. The output budget max_tokens covers reasoning and the visible answer together. When building multi-turn requests, send visible assistant content if that is all you need. Resending earlier reasoning_content counts toward GLM-5.4 input usage. Reasoning and token reference
For actual charges, use the EvoLink usage dashboard or wait briefly after the call completes, then look up the response header’s ID with the same key. The lookup returns status, usage, and billed cost. Request cost API
REQUEST_ID=$(awk 'tolower($1) == "x-request-id:" {gsub(/\r/, "", $2); id=$2} END {print id}' glm-response-headers.txt)
if [ -n "$REQUEST_ID" ]; then
  curl --silent --show-error --fail-with-body \
    "https://api.evolink.ai/v1/requests/$REQUEST_ID" \
    -H "Authorization: Bearer ${EVOLINK_API_KEY:?Set EVOLINK_API_KEY}"
fi

Attach a image, video, or PDF

Keep the same model and endpoint. Change the user message’s content from a string to an array. Send instructions as a text block and an image as an image_url block. The example asks for a short description of this article’s social preview image.
curl --silent --show-error --fail-with-body \
  https://direct.evolink.ai/v1/chat/completions \
  -H "Authorization: Bearer ${EVOLINK_API_KEY:?Set EVOLINK_API_KEY}" \
  -H "Content-Type: application/json" \
  --data-binary @- <<'JSON'
{
  "model": "glm-5.4",
  "messages": [{
    "role": "user",
    "content": [
      {"type": "text", "text": "Describe the main visual elements and their arrangement in one short sentence."},
      {"type": "image_url", "image_url": {"url": "https://cdn.evolink.ai/blog/where-to-use-glm-5-4/og-v1.jpg"}}
    ]
  }],
  "reasoning_effort": "high",
  "max_tokens": 2048,
  "stream": false
}
JSON
InputChat Completions blockWhat to check
Image{"type":"image_url","image_url":{"url":"..."}}Use a public HTTPS URL or an inline data:image/png;base64,... string. Add one block per image.
Video{"type":"video_url","video_url":{"url":"..."}}Use a downloadable video URL. A private link or a failed upstream fetch can return HTTP 400.
PDF{"type":"file","file":{"file_url":"..."}}Use a public PDF URL, or put an inline data:application/pdf;base64,... value in file_data inside the file object.
Replace the ellipses with your own assets and make sure the URLs work without a login. To reproduce a visual bug and verify a patch, follow the GLM-5.4 screenshot repair tutorial. Media request schema

Use an SDK or stream the response

Install the Python client with python -m pip install openai and use the same environment variable. The SDK appends the API path, and extra_body sends EvoLink’s GLM-specific reasoning value. The example leaves retries to the caller.
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://direct.evolink.ai/v1",
    api_key=os.environ["EVOLINK_API_KEY"],
    timeout=120.0,
    max_retries=0,
)
response = client.chat.completions.create(
    model="glm-5.4",
    messages=[{"role": "user", "content": "Reply with exactly READY."}],
    extra_body={"reasoning_effort": "low"},
    max_tokens=1024,
)
print(response.choices[0].message.content)
print(response.usage)
For real-time output, switch the saved JSON request to stream: true. Chat Completions sends Server-Sent Events. Read display text from choices[].delta.content, handle reasoning or tool deltas separately, and stop on data: [DONE]. Some chunks carry usage or a finish reason without display text.
jq '.stream = true' glm-text-request.json |
  curl --no-buffer --silent --show-error --fail-with-body \
    https://direct.evolink.ai/v1/chat/completions \
    -H "Authorization: Bearer ${EVOLINK_API_KEY:?Set EVOLINK_API_KEY}" \
    -H "Content-Type: application/json" \
    --data-binary @-

Choose Chat Completions, Responses, or Anthropic Messages

Keep the EvoLink key and glm-5.4 on all three. Use the protocol your existing application or Agent already speaks. The JSON body and output paths vary by endpoint.
ProtocolURL and main request fieldsWhere to read the answer
Chat CompletionsPOST https://direct.evolink.ai/v1/chat/completions. Send model, messages, and optionally max_tokens and reasoning_effort.choices[0].message.content. Reference
ResponsesPOST https://direct.evolink.ai/v1/responses. Send model, input, and optionally max_output_tokens and reasoning.effort.Look for output_text blocks inside message items in output. Check status and incomplete_details if a response ends early. Quickstart
Anthropic MessagesPOST https://direct.evolink.ai/v1/messages. Send model, messages, and the required max_tokens. Use the same Authorization: Bearer header for raw HTTP.Read text blocks in content separately from any thinking blocks and check stop_reason. Quickstart
Minimal Responses request
curl --silent --show-error --fail-with-body \
  https://direct.evolink.ai/v1/responses \
  -H "Authorization: Bearer ${EVOLINK_API_KEY:?Set EVOLINK_API_KEY}" \
  -H "Content-Type: application/json" \
  --data-binary '{"model":"glm-5.4","input":"Reply with exactly READY.","max_output_tokens":1024,"reasoning":{"effort":"low"}}'
Minimal Anthropic Messages request
curl --silent --show-error --fail-with-body \
  https://direct.evolink.ai/v1/messages \
  -H "Authorization: Bearer ${EVOLINK_API_KEY:?Set EVOLINK_API_KEY}" \
  -H "Content-Type: application/json" \
  --data-binary '{"model":"glm-5.4","max_tokens":1024,"messages":[{"role":"user","content":"Reply with exactly READY."}]}'

Diagnose common API errors

ResultWhat to verify
400 invalid requestValidate the JSON and the selected protocol’s field names. For media, check the content block and whether the URL can be downloaded. Retry the plain-text request to isolate the issue.
401 authenticationCheck that your process has the current EvoLink key and sends the Bearer header.
402 insufficient quotaCheck available credits or account quota before retrying.
403 or 404Check the key’s permissions, the exact endpoint path, and model ID glm-5.4.
429 or temporary 5xxHonor Retry-After when present. Otherwise retry with bounded backoff and jitter. Save the request ID and check usage before resending a timed-out request.
Once text and image requests work, keep a representative request and check the output, latency, and cost on every model change. For an image-based comparison, run the same prompt and screenshot on GLM-5.3 Flash using the same gateway and acceptance checks.

API rates and cost per accepted result

Suppose a multimodal request uses 10,000 uncached input tokens for the image and accompanying text, and 2,000 billed output tokens. The example assumes no cached input or separate tool fees and uses Z.ai’s and BigModel’s published direct API rates.
Attempts needed to get an accepted resultZ.ai international APIBigModel API
One attempt$0.0228¥0.136
Two attempts at the same token usage$0.0456¥0.272
Media is counted toward input usage. In a real workflow, cache hits, follow-ups, and output length can change the bill. Use the EvoLink GLM-5.4 pricing section for EvoLink’s rates and the dashboard for actual charges. Z.ai prices · BigModel prices

Can you run the model locally?

  • GLM-5.4 — Z.ai’s public Hugging Face catalog showed no official checkpoint as of December 2. A hosted API is the practical option if your workflow needs this exact model now. Z.ai’s public catalog
  • GLM-5.3 — Z.ai publishes weights and deployment instructions for this text-only predecessor. Check the license, runtime, and hardware requirements before choosing it for self-hosting. GLM-5.3 model card

Frequently asked questions

Use glm-5.4 with an EvoLink API key. In an OpenAI-compatible SDK, set the base URL to https://direct.evolink.ai/v1. For raw Chat Completions, send POST to https://direct.evolink.ai/v1/chat/completions with a Bearer header and a JSON body containing model and messages.

Can I try GLM-5.4 for free?

ZCode documents a limited Start Plan for eligible new users in its official app. Sign in to see the available quota and expiry. For EvoLink API testing, check the current token rates. ZCode Start Plan

Do I need a GLM Coding Plan to call the API?

The Coding Plan grants quota in supported tools. EvoLink’s pay-as-you-go API uses an EvoLink key, while Z.ai and BigModel use their own standard keys and billing. For Claude Code on the Coding Plan, ZCode documents the alias glm-5.4[1m]. EvoLink keys · ZCode model setup

Can I download the model for local deployment?

As of December 2, Z.ai’s public catalog had no official GLM-5.4 weights. Check the exact checkpoint, license, and runtime when a download becomes available. Public model catalog

Connect AI models through one API

Compare models and current pricing, then follow the API documentation to integrate your chosen model.