Live GLM-5 and GLM-5.3 API pricing on Inference.net
On Inference.net, GLM API pricing starts at $0.084 per 1M fresh input tokens, $0.079 per 1M cached reads, and $3.00 per 1M output tokens on glm-5.3 (1,048,576 context window, 943,718 max output tokens). For high-volume, output-heavy, or multimodal workloads, glm-5.3-flash costs $0.10 fresh input, $0.03 cached reads (70.0% discount), and $0.35 output per 1M tokens with text, image, and video inputs. Both glm-5.3 and glm-5.3-flash expose OpenAI /v1/chat/completions, /v1/responses, and native Anthropic /v1/messages with one API key.
All model IDs, context limits, and per-1M-token rates below were verified directly from GET https://api.inference.net/v1/models on 2026-12-06 (the API returns per-token prices; multiply by 1,000,000 for per-1M rates):
| Model ID | Context / max output | Fresh input ($/1M) | Cached read ($/1M) | Output ($/1M) | Tools & modalities | Hosting & ZDR scope | Model page |
|---|---|---|---|---|---|---|---|
glm-5.3 | 1,048,576 / 943,718 | $0.084 | $0.079 | $3.00 | Tools, text | Inference.net-hosted (US, ZDR) | GLM-5.3 |
glm-5.3-flash | 1,048,576 / 262,144 | $0.10 | $0.03 | $0.35 | Tools, text + image + video | Inference.net-hosted (US, ZDR) | GLM-5.3 Flash |
glm-5.2 | 1,048,576 / 943,718 | $1.30 | $0.20 | $4.40 | Tools, text | External route (upstream terms) | GLM-5.2 |
glm-5.2-fast | 1,000,000 / 128,000 | $2.60 | $0.40 | $8.80 | Tools, text | External route (upstream terms) | GLM-5.2 Fast |
glm-5 | 204,800 / 131,072 | $0.95 | $0.20 | $2.55 | Text (supports_tools: false) | External route (upstream terms) | GLM-5 |
Note: glm-5.3 and glm-5.3-flash are always-thinking models supporting low, high, and max reasoning efforts (reasoning_effort: "none" is not supported). See Reasoning docs for per-model effort matrices.
Which GLM model should you pick?
- Deep coding, architecture, and long-output synthesis:
glm-5.3($0.084/$0.079cached /$3.00output). Lowest fresh input rate in the GLM family, 943,718 max output ceiling, Inference.net-hosted US infrastructure, and default Zero Data Retention. - Cost-sensitive coding loops, multimodal agents, and extraction:
glm-5.3-flash($0.10/$0.03cached /$0.35output). Output tokens cost 8.6x less thanglm-5.3, cached input reads drop by 70.0%, and it addsimageandvideoinput modalities alongside 1M context and hosted US ZDR. - Migrating off legacy GLM-5.2 or GLM-5:
glm-5.2($1.30/$4.40),glm-5.2-fast($2.60/$8.80), andglm-5($0.95/$2.55, no tool calling, 204K context) are externally routed and cost significantly more thanglm-5.3andglm-5.3-flash. Move production workloads toglm-5.3orglm-5.3-flashunless pinned to an older checkpoint.
Compare models side by side on the GLM API hub, GLM-5.3 vs GLM-5.3 Flash, or DeepSeek V4.1 Flash vs GLM-5.3 Flash.
GLM prompt caching: why prompt_cache_key is required
Unlike DeepSeek V4.1 Flash or Kimi K3 (which rely on implicit prefix caching without a cache key), GLM routes on Inference.net require an explicit prompt_cache_key for reliable cache affinity:
- On
glm-5.3,glm-5.3-flash,glm-5.2, andglm-5.2-fast: Keep the leading prompt prefix byte-identical across calls (same system prompt, same tool order, same static context) AND pass a stableprompt_cache_keystring in the request body.prompt_cache_keyis a routing-affinity hint; it does not create or identify cached content on its own. - On
glm-5: Pass BOTH a stablesession_idstring for routing stickiness and a stableprompt_cache_keystring for cache affinity alongside byte-identical leading messages. - Never reuse GLM's
prompt_cache_keyon DeepSeek V4.1 Flash: DeepSeek V4.1 Flash and V4 Pro routes use implicit caching withoutprompt_cache_keyand may reject requests that send it. If you route across both families in one app, attachprompt_cache_keyonly to GLM (and OpenAI) requests. - Verify cached reads on every call: Inspect
usage.prompt_tokens_details.cached_tokensin the JSON response (passstream_options: { "include_usage": true }when streaming).
{
"model": "glm-5.3-flash",
"prompt_cache_key": "repo-backend-v1",
"messages": [
{ "role": "system", "content": "Stable system instructions and repository context..." },
{ "role": "user", "content": "Write unit tests for the token bucket middleware." }
]
}40-turn coding-agent cost math
This breakdown uses the exact Coding Agent preset: 40 turns per session, 14,000 average input tokens per turn (560K total input = 84K fresh + 476K cached reads at an 85% cache hit rate), and 900 average output tokens per turn (36K total output). Monthly spend scales to 750,000 requests/month (18,750 sessions).
| Model ID | Fresh input (84K) | Cached read (476K) | Output (36K) | 40-turn session (85% cache) | Session without cache | Monthly (750K reqs) |
|---|---|---|---|---|---|---|
glm-5.3-flash | $0.0084 | $0.0143 | $0.0126 | $0.0353 | $0.0686 | $661.50 |
glm-5.3 | $0.0071 | $0.0376 | $0.1080 | $0.1527 | $0.1550 | $2,862.38 |
glm-5 | $0.0798 | $0.0952 | $0.0918 | $0.2668 | $0.6238 | $5,002.50 |
glm-5.2 | $0.1092 | $0.0952 | $0.1584 | $0.3628 | $0.8864 | $6,802.50 |
glm-5.2-fast | $0.2184 | $0.1904 | $0.3168 | $0.7256 | $1.7728 | $13,605.00 |
What the math shows:
glm-5.3-flashcuts 40-turn session cost by 48.6% withprompt_cache_key: Going from 0% to 85% cache hits drops the session from$0.0686to$0.0353($661.50/monthat 750K requests).glm-5.3is 2.4x cheaper thanglm-5.2per coding session:$0.1527vs$0.3628, with 70.7% of theglm-5.3session bill coming from output tokens ($0.1080). Keepreasoning_effort: "low"on routine turns if you want to cap output token volume.- Single-turn 500K-token analysis (0% cache, 4K output):
glm-5.3costs$0.0540($0.0420input +$0.0120output) andglm-5.3-flashcosts$0.0514($0.0500input +$0.0014output), compared to$0.6676onglm-5.2.
Model your own prompt sizes and cache hit ratios in the LLM Pricing Calculator or Prompt Cache Calculator.
Quickstart: OpenAI SDK (with prompt_cache_key) and Anthropic /v1/messages
Create a free account at /register and generate a key in API keys. Export INFERENCE_API_KEY in your shell:
export INFERENCE_API_KEY="inf_sk_..."OpenAI Python SDK with prompt_cache_key
Pass prompt_cache_key through extra_body in the official OpenAI Python SDK so consecutive calls in the same conversation or shared-system pipeline keep routing affinity:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.inference.net/v1", # or https://us.api.inference.net/v1
api_key=os.environ["INFERENCE_API_KEY"],
)
stream = client.chat.completions.create(
model="glm-5.3",
stream=True,
stream_options={"include_usage": True},
reasoning_effort="low",
extra_body={"prompt_cache_key": "repo-api-service-v1"},
messages=[
{"role": "system", "content": "You are a concise backend engineer. Output valid TypeScript."},
{"role": "user", "content": "Implement an idempotency-key middleware for HTTP POST handlers."},
],
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
if chunk.usage:
cached = getattr(chunk.usage.prompt_tokens_details, "cached_tokens", 0) or 0
print(f"\n[usage] prompt={chunk.usage.prompt_tokens} cached={cached} output={chunk.usage.completion_tokens}")Native Anthropic SDK (/v1/messages)
Both glm-5.3 and glm-5.3-flash work natively over POST https://api.inference.net/v1/messages. Set base_url="https://api.inference.net" without /v1 because the Anthropic SDK appends /v1/messages automatically (see Anthropic SDK docs and Claude Code setup).
import os
from anthropic import Anthropic
client = Anthropic(
base_url="https://api.inference.net",
auth_token=os.environ["INFERENCE_API_KEY"],
)
message = client.messages.create(
model="glm-5.3-flash",
max_tokens=2048,
messages=[
{"role": "user", "content": "Summarize three failure modes of distributed cron locks."}
],
)
for block in message.content:
if block.type == "text":
print(block.text)Privacy, Zero Data Retention, and US routing
Inference.net enables Zero Data Retention by default for new accounts under SOC 2 Type II controls on eligible Inference.net-hosted routes (glm-5.3 and glm-5.3-flash), and both models support the US-only host https://us.api.inference.net/v1. Externally routed legacy models (glm-5.2, glm-5.2-fast, glm-5) are excluded from Inference.net's ZDR policy and follow their upstream provider's data-handling and retention terms.
Frequently asked questions
What is the difference between glm-5.3 and glm-5.3-flash?
Both are Inference.net-hosted US models with a 1,048,576-token context window, tool calling, default ZDR, and low/high/max reasoning efforts. glm-5.3 ($0.084 input / $0.079 cached / $3.00 output per 1M) is text-only with a 943,718-token max output ceiling for deeper coding and long-form synthesis. glm-5.3-flash ($0.10 input / $0.03 cached / $0.35 output per 1M) adds image and video input modalities, cuts output token cost by 8.6x, and gives a 70.0% cached-read discount.
How do I enable prompt caching on GLM-5.3 and GLM-5.3 Flash?
Keep your leading system instructions, tool definitions, and static context byte-identical across turns and pass a stable prompt_cache_key string in every request body. Check usage.prompt_tokens_details.cached_tokens to verify cache hits. For legacy glm-5, pass both session_id and prompt_cache_key.
Can I turn off thinking with reasoning_effort: "none" on GLM-5.3?
No. glm-5.3 and glm-5.3-flash are always-thinking models supporting low, high, and max reasoning efforts. Pass reasoning_effort: "low" to minimize reasoning token overhead and latency, or switch to deepseek-v4.1-flash-1017 or moonshotai/kimi-k3.1-pro if you need reasoning_effort: "none".
Can I use GLM-5.3 in Claude Code, OpenCode, or LiteLLM Proxy?
Yes. Use glm-5.3 or glm-5.3-flash natively in Claude Code, OpenCode, Cursor, and LiteLLM Proxy with openai/glm-5.3 or openai/glm-5.3-flash.
Related GLM resources
- Model hub & specs: GLM API Hub · GLM-5.3 · GLM-5.3 Flash · GLM-5.2
- Calculators & comparisons: LLM Pricing Calculator · Prompt Cache Calculator · GLM-5.3 vs GLM-5.3 Flash · Kimi K3 vs GLM-5.3 · DeepSeek V4.1 Flash vs GLM-5.3 Flash
- Next guides: Kimi K3 Pricing Guide · DeepSeek API Pricing Guide · OpenCode DeepSeek & Kimi Setup · Cheapest LLM API Guide
Start calling GLM-5.3 and GLM-5.3 Flash with 1M context
Create a free Inference.net API key to run glm-5.3 and multimodal glm-5.3-flash over OpenAI and native Anthropic /v1/messages with prompt_cache_key support and hosted US ZDR.
Create API key