All insights

Model APIs

Zhipu AI API: Endpoints, Authentication, First Request, and Pricing

Set up a Z.ai GLM API request with the documented endpoint, Bearer authentication, and a working curl example. See how the BigModel route and GLM Coding Plan differ.

Illustration for Zhipu ai api

Quick answer

For a standard API request on Z.ai, create a Standard API Key and send a POST request to https://api.z.ai/api/paas/v4/chat/completions with Authorization: Bearer YOUR_API_KEY. Z.ai’s quick start uses glm-5.3. Zhipu AI Open documents its own chat-completions endpoint and a GLM-5.3 request example; follow that platform’s instructions rather than assuming changing only the host makes requests interchangeable. GLM Coding Plan is a separate product: use its supported setup and tools, not the standard API example. (Z.ai Quick Start; Zhipu AI Open GLM-5.3 guide)

Choose the platform and endpoint

Product and documentation Chat-completions endpoint What to do
Standard API on Z.ai https://api.z.ai/api/paas/v4/chat/completions Use the Z.ai Standard API Key and the Z.ai request example below.
Zhipu AI Open https://open.bigmodel.cn/api/paas/v4/chat/completions Follow the BigModel GLM-5.3 guide and its linked API example for this route.
GLM Coding Plan Use the plan’s own documented setup Its keys and usage conditions are separate from the standard API. Follow the Coding Plan quick start and usage policy; don’t treat the curl example below as an eligible plan integration.

Z.ai and Zhipu AI Open document their standard API routes separately. For BigModel, use its platform-specific example rather than relying on a host-only substitution. Coding Plan documentation describes separately managed keys, and its usage policy limits access to officially supported tools and products. (Z.ai API reference; Zhipu AI Open chat-completions API; Coding Plan usage policy)

Get a key and make your first Z.ai request

  1. In the Z.ai platform, create a Standard API Key from the API Keys management page, as described in the quick start.
  2. Set it in your shell so you don’t put the secret directly in your source code:
export ZAI_API_KEY="your_api_key"
  1. Send a minimal request to Z.ai’s standard API endpoint:
curl --request POST \
  --url "https://api.z.ai/api/paas/v4/chat/completions" \
  --header "Authorization: Bearer ${ZAI_API_KEY}" \
  --header "Content-Type: application/json" \
  --data '{
    "model": "glm-5.3",
    "messages": [
      {"role": "user", "content": "Reply with a short greeting."}
    ]
  }'

This example is specifically for the standard Z.ai API. For BigModel, use its own documented GLM-5.3 request example; for Coding Plan, follow the plan’s supported-tool setup instead.

A successful chat completion returns an HTTP 200 response with a choices array. The assistant’s text is in choices[0].message.content. The chat-completions reference documents the response shape; check the HTTP status and response body in your application.

Which model should you start with?

For a text-only chat request on the standard Z.ai route, glm-5.3 is the model used in Z.ai’s quick-start example. Its model guide documents text-only input, a 1-million-token context window, and a maximum output of 128,000 tokens. Reasoning is always enabled; the documented reasoning_effort settings are low, high, and max. (Z.ai GLM-5.3 model guide)

For image, video, text, or file input, Z.ai documents glm-5.3-flash and related Flash model codes, with a 1-million-token context window and a maximum output of 128,000 tokens. Check the Flash model guide for the model code and request format that fit your use case. Confirm the model is available for your selected platform and product before switching.

Standard API pricing and Coding Plan are different

Z.ai’s pricing page lists USD rates per 1 million tokens for standard model API usage. It lists:

Model Input Cached input Cached input storage Output
glm-5.3 $1.40 $0.26 Limited-time free $4.40
glm-5.3-flash $0.15 $0.03 Limited-time free $0.50

These are the rate categories and amounts shown on the official pricing page; confirm current terms there before budgeting. Coding Plan is a separate product with its own setup and supported-use conditions, so don’t assume these standard API token rates describe a Coding Plan subscription.

Before connecting a production workload

  • Confirm that your API key, model, endpoint, and product belong together; use the platform-specific request documentation.
  • Check the current model guide for supported inputs and request limits relevant to your use.
  • Review the provider’s current pricing and account or plan terms before estimating usage costs.
  • Keep the key in server-side configuration or a secrets manager, not public client code or a committed file.

Bottom line: start with the standard Z.ai endpoint, a Z.ai Standard API Key sent as a Bearer token, and glm-5.3 for a text chat request. If you use Zhipu AI Open or GLM Coding Plan, follow that route’s own documentation and eligibility requirements.

Sources

Z.AI Quick Start

Z.AI API Reference: Introduction

Z.AI Chat Completion API

Zhipu AI Open: GLM-5.3 Model Guide

Zhipu AI Open: Chat Completions API

Z.AI GLM Coding Plan Quick Start

Z.AI GLM Coding Plan Usage Policy

Z.AI GLM-5.3 Model Guide

Z.AI GLM-5.3-Flash Model Guide

Z.AI Pricing

Contact us