GLM API
Run every live Z.ai GLM model through one serverless Inference.net API with OpenAI /v1/chat/completions and native Anthropic /v1/messages support. Compare live per-token pricing, cached-read savings, and context windows up to 1M tokens across GLM-5.3, GLM-5.3 Flash, and GLM-5.2, with Zero Data Retention on eligible Inference.net-hosted routes.
- Serverless per-token billing with cached-read discounts
- Zero Data Retention (ZDR) by default on eligible Inference.net-hosted routes (SOC 2 Type II)
- OpenAI /v1/chat/completions and native Anthropic /v1/messages support
- High-value coding and tool-calling tiers from GLM-5.3 Flash to GLM-5.3
All live GLM models on Inference.net
Every rate, context limit, and capability below is pulled directly from the live public catalog. Select any model for full specs, live latency benchmarks, and prompt-caching guidance.
| Model | Context | Max output | Input / 1M | Cached / 1M | Output / 1M | Capabilities | Start |
|---|---|---|---|---|---|---|---|
GLM-5.3 glm-5.3 | 1M | 944K | $0.084 | $0.079 | $3.00 | Tools, Reasoning | Use API |
GLM-5.3-Flash glm-5.3-flash | 1M | 262K | $0.10 | $0.03 | $0.35 | Vision, Tools, Reasoning | Use API |
GLM-5.2 glm-5.2 | 1M | 944K | $1.30 | $0.20 | $4.40 | Tools, Reasoning | Use API |
GLM-5.2 Fast glm-5.2-fast | 1M | 128K | $2.60 | $0.40 | $8.80 | Tools | Use API |
GLM-5 glm-5 | 205K | 131K | $0.95 | $0.20 | $2.55 | Text | Use API |
Call GLM over OpenAI or Anthropic SDKs
Use the top live model ID (glm-5.3) with the standard OpenAI SDK, curl, or Claude Code over native /v1/messages.
import OpenAI from 'openai'
const client = new OpenAI({
baseURL: 'https://api.inference.net/v1',
apiKey: process.env.INFERENCE_API_KEY,
})
const completion = await client.chat.completions.create({
model: 'glm-5.3',
messages: [{ role: 'user', content: 'Hello' }],
})import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.inference.net/v1",
api_key=os.environ["INFERENCE_API_KEY"],
)
completion = client.chat.completions.create(
model="glm-5.3",
messages=[{"role": "user", "content": "Hello"}],
)curl https://api.inference.net/v1/chat/completions \
-H "Authorization: Bearer $INFERENCE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3",
"messages": [
{ "role": "user", "content": "Hello" }
]
}'Point Claude Code or any Anthropic SDK client at Inference.net with zero proxy setup and full prompt-cache support.
export ANTHROPIC_BASE_URL="https://api.inference.net"
export ANTHROPIC_AUTH_TOKEN="$INFERENCE_API_KEY"
export ANTHROPIC_MODEL='glm-5.3[1m]'
export ANTHROPIC_DEFAULT_OPUS_MODEL='glm-5.3[1m]'
export ANTHROPIC_DEFAULT_SONNET_MODEL='glm-5.3[1m]'
export ANTHROPIC_DEFAULT_HAIKU_MODEL='glm-5.3[1m]'
export CLAUDE_CODE_SUBAGENT_MODEL='glm-5.3[1m]'
claudeBenchmark, compare, and model GLM costs
Verify unit economics across prompt-cache hit rates, compare providers, and explore engineering guides for GLM.
Explore other open-weight model families
Switch across DeepSeek, Kimi, GLM, and the full catalog with one API key and one OpenAI-compatible client.
Frequently asked questions.
Quick answers to help you get started
Inference.net currently serves 5 live GLM models with transparent pay-as-you-go per-token billing. Input rates start at $0.084 per 1M input tokens ($3.00 per 1M output tokens) on GLM-5.3. Every rate in the comparison table above pulls directly from the live public catalog.
Yes. Pass a stable prompt_cache_key on GLM-5.3, GLM-5.3 Flash, and GLM-5.2 routes (and prompt_cache_key or x-session-id on GLM-5) while keeping repeated system instructions, tool schemas, and repository context byte-identical across turns. On GLM-5.3, cached input reads are $0.079 per 1M tokens (6% less than standard input). Estimate multi-turn savings with the Prompt Cache Calculator.
Yes. Point the official OpenAI TypeScript or Python SDK to https://api.inference.net/v1 with your INFERENCE_API_KEY and set model to "glm-5.3". You can also call supported GLM models over the native Anthropic /v1/messages endpoint for Anthropic SDK apps and Claude Code.
Yes, on eligible Inference.net-hosted routes. Zero Data Retention (ZDR) is enabled by default for new accounts under SOC 2 Type II controls, so prompts and completions on Inference.net-hosted models are not stored after processing or used to train models. Externally routed catalog models are excluded from our ZDR policy and follow their upstream provider's data-handling and retention terms. Review our ZDR policy for full details. Requests run over https://api.inference.net/v1, and US-pinned routes are available on supported models via https://us.api.inference.net/v1.
Live GLM models on Inference.net scale up to a 1M-token context window (1,048,576 tokens) and up to 944K output tokens on GLM-5.3. Context limits and caching vary by checkpoint, so check each model row above for exact specs and multimodal capabilities.
Start calling GLM in minutes
Create a project API key with Zero Data Retention enabled by default on eligible Inference.net-hosted routes and route requests to glm-5.3 with pay-as-you-go billing.