---
title: "GLM API: GLM-5.3, Flash & GLM-5.2 Pricing | Inference.net"
description: "Run GLM-5.3, GLM-5.3 Flash, and GLM-5.2 on one serverless API. Live pricing, up to 1M context, prompt caching, hosted ZDR, and Claude Code."
url: "https://inference.net/models/glm/"
---

GLM API

# 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

[Get GLM API key](https://inference.net/register/?model=glm-5-3) [Estimate monthly cost](https://inference.net/tools/llm-pricing-calculator/) [Full model catalog](https://inference.net/models/)

LIVE CATALOG & PRICING

## 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](https://inference.net/models/glm-5-3/) `glm-5.3` | 1M | 944K | $0.084 | $0.079 | $3.00 | Tools, Reasoning | [Use API](https://inference.net/register/?model=glm-5-3) |
| [GLM-5.3-Flash](https://inference.net/models/glm-5-3-flash/) `glm-5.3-flash` | 1M | 262K | $0.10 | $0.03 | $0.35 | Vision, Tools, Reasoning | [Use API](https://inference.net/register/?model=glm-5-3-flash) |
| [GLM-5.2](https://inference.net/models/glm-5-2/) `glm-5.2` | 1M | 944K | $1.30 | $0.20 | $4.40 | Tools, Reasoning | [Use API](https://inference.net/register/?model=glm-5-2) |
| [GLM-5.2 Fast](https://inference.net/models/glm-5-2-fast/) `glm-5.2-fast` | 1M | 128K | $2.60 | $0.40 | $8.80 | Tools | [Use API](https://inference.net/register/?model=glm-5-2-fast) |
| [GLM-5](https://inference.net/models/glm-5/) `glm-5` | 205K | 131K | $0.95 | $0.20 | $2.55 | Text | [Use API](https://inference.net/register/?model=glm-5) |

QUICKSTART

## 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`.

QUICKSTART [Get API key](https://inference.net/register/?model=glm-5-3)

```typescript
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' }],
})
```

```python
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
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" }
    ]
  }'
```

CLAUDE CODE & ANTHROPIC /V1/MESSAGES

Point Claude Code or any Anthropic SDK client at Inference.net with zero proxy setup and full prompt-cache support.

```bash
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]'
claude
```

[Claude Code setup guide](https://inference.net/docs/integrations/claude-code/) [Anthropic SDK docs](https://inference.net/docs/api/anthropic-sdk/)

COMPARISONS, GUIDES & TOOLS

## Benchmark, compare, and model GLM costs

Verify unit economics across prompt-cache hit rates, compare providers, and explore engineering guides for GLM.

[COMPARISON GLM-5.3 vs GLM-5.3 Flash Compare flagship GLM-5.3 against ultra-low-cost GLM-5.3 Flash on pricing and context. Read comparison](https://inference.net/compare/glm-5-3-vs-glm-5-3-flash/) [COMPARISON Kimi K3 vs GLM-5.3 Compare Moonshot AI Kimi K3 and Z.ai GLM-5.3 across live rates and capabilities. Read comparison](https://inference.net/compare/kimi-k3-vs-glm-5-3/) [COMPARISON DeepSeek V4.1 Flash vs GLM-5.3 Flash Side-by-side live pricing and 1M-context specs for DeepSeek V4.1 Flash and GLM-5.3 Flash. Read comparison](https://inference.net/compare/deepseek-v4-1-flash-vs-glm-5-3-flash/) [GUIDE Best Open-Source LLMs Guide Workload-by-workload guide to open-weight models for coding, extraction, and agents. Read guide](https://inference.net/guides/best-open-source-llms/) [GUIDE Cheapest LLM API Guide Verified per-1M token rates and cached-read math across open-weight serverless APIs. Read guide](https://inference.net/guides/cheapest-llm-api/) [GUIDE Claude Code Alternatives Guide Point Claude Code and open coding harnesses at GLM-5.3 over native /v1/messages. Read guide](https://inference.net/guides/claude-code-alternatives/) [CALCULATOR LLM Pricing Calculator Estimate monthly token spend across live GLM models and sibling open-weight tiers. Open calculator](https://inference.net/tools/llm-pricing-calculator/) [CALCULATOR Prompt Cache Calculator Model 50%, 75%, and 90% cache hit-rate savings for multi-turn coding agents and RAG workflows. Calculate savings](https://inference.net/tools/prompt-cache-calculator/) [INTEGRATION Claude Code Integration Connect Claude Code directly to GLM models on Inference.net using native /v1/messages. Read docs](https://inference.net/docs/integrations/claude-code/)

MODEL FAMILIES

## Explore other open-weight model families

Switch across DeepSeek, Kimi, GLM, and the full catalog with one API key and one OpenAI-compatible client.

[DEEPSEEK API DeepSeek API DeepSeek V4.1 Flash, V4 Pro, and V3.2 with up to 1M context and automatic prompt caching on supported V4.1 and V4 Pro routes, plus default ZDR on hosted routes. Explore DeepSeek models](https://inference.net/models/deepseek/) [KIMI API Kimi API Kimi K3.1 Pro, K3, K3 Fast, and K2.6 for agentic coding, multimodal reasoning, and up to 1M context on K3 models. Explore Kimi models](https://inference.net/models/kimi/) [QWEN API Qwen API Qwen 3.7 Plus, Qwen 3 30B A3B, and Qwen 3 14B with up to 1M context, multimodal input, and implicit caching on Qwen 3.7 Plus. Explore Qwen models](https://inference.net/models/qwen/) [SCHEMATRON API Schematron API Schematron V2 Turbo and V2 Small for high-throughput HTML-to-JSON structured extraction with 128K context, US residency, and default ZDR. Explore Schematron models](https://inference.net/models/schematron/) [GROK API Grok API Grok 4.6 and Grok 4.5 with 500K context, vision, configurable reasoning, and x-grok-conv-id prompt caching over one API key. Explore Grok models](https://inference.net/models/grok/) [FULL CATALOG All Models & Pricing Search, sort, and compare every live open-weight and frontier model on Inference.net. Browse all models](https://inference.net/models/)

FAQ

## Frequently asked questions.

Quick answers to help you get started

### How much does the GLM API cost on Inference.net?

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.

### Does Inference.net support prompt caching for GLM models?

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.

### Can I call GLM models with the OpenAI SDK, Anthropic SDK, or Claude Code?

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.

### Does Inference.net offer Zero Data Retention for the GLM API?

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](https://inference.net/zero-data-retention/) 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.

### What context windows and capabilities do GLM models support?

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.

GET STARTED

## 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.

[Create free API key](https://inference.net/register/?model=glm-5-3) [API quickstart docs](https://inference.net/docs/api/quickstart/)
