Z.ai: GLM-5-Code

zai/glm-5-code

Z.ai GLM-5-Code API pricing

GLM-5-Code costs $0.480 per million input tokens and $2.00 per million output tokens on Oxyy. These are the pay-as-you-go prices after the current 60% discount (Launch Promo; standard price $1.20 input and $5.00 output), and cached input tokens are billed at $0.120 per million. It accepts text and returns text. A cheaper Z.ai option is GLM-4.5-AirX at $0.440 / $1.80 per 1M tokens; for every model and rate, see GLM API pricing.

Coding-specialized variant of GLM-5.
ModalitiesTextText
Price$0.480 / $2.00 per 1M tokens in / outAll GLM API pricing

Providers

Where this model runs, and what each route costs. Requests are sent to a healthy provider automatically; if one errors, the gateway retries against another serving the same model.

ProviderInput /MOutput /MCache read /M
Z.ai$0.480$2.00$0.120

Capabilities (6)

StreamingTool callingStructured outputThinkingPrompt cachingWeb search

Supported parameters (2)

toolsresponse_format

A parameter not listed here may be removed before the request reaches the model. When it is, the request still succeeds and the response names it, with the reason, in provider_specific_fields.dropped_params. Thinking controls work as described below whether or not they are listed.

Thinking

Thinking can be turned off: send reasoning_effort: "none", or thinking: {type: "disabled"}. reasoning_effort takes minimal, low, medium, high, xhigh, max, each mapped to the level the model uses for it where the model's levels are known (sometimes a higher level than the word asked for, or off); when it differs, the response names the level used in provider_specific_fields.dropped_params.

Pricing

What this model costs on Oxyy, pay as you go. "Charged" is the rate a request is billed at; the standard price is shown beside it for reference.

Input price
$0.480
per 1M input tokens · standard price $1.20
Output price
$2.00
per 1M output tokens · standard price $5.00
RateStandard priceChargedUnit
Input$1.20$0.480per 1M input tokens
Output$5.00$2.00per 1M output tokens
Cached input$0.300$0.120per 1M cached input tokens

Discount. Charged rates include the current "Launch Promo" discount of 60% on every rate.

UTC

Specifications

Model ID
glm-5-code
Developer
Z.ai
Type
Text
Input
Text
Output
Text
Series
GLM-5
Endpoint
/v1/chat/completions

Best for

CodingAgentic

Quickstart

Call glm-5-code with a POST to /v1/chat/completions on https://api.oxyy.ai, using your Oxyy API key from the OXYY_API_KEY environment variable. The same key works for every model in the catalog.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.oxyy.ai/v1",
    api_key=os.environ["OXYY_API_KEY"],
)

response = client.chat.completions.create(
    model="glm-5-code",
    messages=[
        {"role": "user", "content": "Explain unified AI APIs in one sentence."},
    ],
)
print(response.choices[0].message.content)

Availability

The share of requests to this model that completed successfully over the last 30 days. Requests the caller cancelled, and requests still in flight, are not counted. When an upstream provider errors, the gateway retries against another provider serving the same model, so a single provider incident does not necessarily show up here.

Success rate (30 days)
0.00%
over 101 completed requests
Days with traffic
5
of the last 30 days

Days are UTC days. Days with no completed requests are omitted rather than drawn at 100% — no traffic is not evidence of availability.

Frequently asked questions

What is GLM-5-Code?
Coding-specialized variant of GLM-5.
How much does GLM-5-Code cost?
GLM-5-Code costs $0.480 per million input tokens and $2.00 per million output tokens on Oxyy. These are the pay-as-you-go prices after the current 60% discount (Launch Promo; standard price $1.20 input and $5.00 output), and cached input tokens are billed at $0.120 per million. You pay per request, with no subscription.
Does GLM-5-Code support tool calling and structured outputs?
Yes — GLM-5-Code supports both tool calling and structured outputs.
What inputs and outputs does GLM-5-Code support?
GLM-5-Code accepts text as input and returns text.
Which API endpoint does GLM-5-Code use?
Send a POST request to https://api.oxyy.ai/v1/chat/completions with "model": "glm-5-code", authenticated with your Oxyy API key. It is also served on /v1/responses (Responses API).
What other models does Z.ai have?
Z.ai also offers GLM-4-32B-0414-128K, GLM-4.5, GLM-4.5-Air and GLM-4.5-AirX through Oxyy.

Alternatives to GLM-5-Code

Models of the same kind from other vendors, closest in price first. Prices are pay-as-you-go on Oxyy, through the same API key.

Explore more models

More models from Z.ai