Skip to main content
AnyAIGC

Zhipu Z.ai · GLM

GLM API

Zhipu's GLM-5.3, GLM-5.3-Flash and GLM-5.2 on one API key. GLM-5.3 is about 30% off the official price, and GLM-5.3-Flash about 60% off.

OpenAI-compatible /v1/chat/completions that also plugs into Claude Code. glm-5.3-flash starts at $0.0607 per 1M input tokens, with unlimited concurrency.

  • Models GLM-5.3 · 5.3-Flash · 5.2
  • Context 1M
  • Input From $0.0607 / 1M
  • Concurrency Unlimited
  • Business Self-service invoices
Pricing

GLM API pricing

Pay per token at fixed rates, with no subscription or monthly fee. GLM-5.3 and GLM-5.2 are about 30% off Zhipu's official USD prices, and GLM-5.3-Flash about 60% off.

  • Per tokenInput, output and cache priced separately
  • 30–60% offvs Zhipu official USD prices
  • Unlimited concurrencyOn by default for every user
  • USDOne balance for 300+ models
GLM prices per 1M tokens (USD), AnyAIGC vs Zhipu official
ItemAnyAIGCZhipu officialSavings
glm-5.3 · GLM-5.3
Inputper 1M tokens$0.9450$1.4033%
Outputper 1M tokens, incl. thinking$2.9700$4.4033%
Cache hitper 1M tokens$0.1758$0.2632%
glm-5.3-flash · GLM-5.3-Flash
Inputper 1M tokens$0.0607$0.1560%
Outputper 1M tokens, incl. thinking$0.2025$0.5060%
Cache hitper 1M tokens$0.0122$0.0359%
glm-5.2 · GLM-5.2
Inputper 1M tokens$0.9450$1.4033%
Outputper 1M tokens, incl. thinking$2.9700$4.4033%
Cache hitper 1M tokens$0.2362$0.269%

Prices are in USD and billed on the tokens you actually use. Output includes thinking tokens, and repeated prompt prefixes are billed at the cache-hit rate automatically. Official prices come from the Zhipu Z.ai pricing page (USD). The table shows the lowest price in the model catalog; see the AnyAIGC model catalog for live pricing.

Cost examples

Estimates for common workloads. The struck-through figure is the same usage at Zhipu official prices.

  • GLM-5.3 · 20 agent coding turns

    Each turn: 50K cache-hit tokens + 5,000 input + 3,000 output

    $0.449

    Official $0.664

  • GLM-5.3-Flash · classify 10,000 tickets

    Each ticket: 2,000 input tokens + 300 output

    $1.82

    Official $4.50

  • GLM-5.2 · review 100 PRs

    Each PR: 20K input tokens + 2,000 output

    $2.48

    Official $3.68

Compare

GLM-5.3 vs GLM-5.3-Flash vs GLM-5.2

Send the hardest work to GLM-5.3, high-volume and image tasks to GLM-5.3-Flash, and use GLM-5.2 when thinking should be off.

GLM-5.3, GLM-5.3-Flash and GLM-5.2 compared; prices are AnyAIGC USD per 1M tokens
SpecGLM-5.3GLM-5.3-FlashGLM-5.2
RoleLatest flagshipNative multimodal, low costLong-horizon flagship
Context / max output1M / 128K1M / 128K1M / 128K
InputTextText, imagesText
ThinkingAlways onAlways onOn or off
AnyAIGC inputper 1M tokens$0.9450$0.0607$0.9450
AnyAIGC outputper 1M tokens$2.9700$0.2025$2.9700
Cache hitper 1M tokens$0.1758$0.0122$0.2362

Specs come from Zhipu Z.ai's official docs. Prices are current AnyAIGC prices; see the model catalog for live pricing.

Use cases

What teams build with the GLM API

  • 01 · Complex coding

    Large refactors and terminal tasks

    GLM-5.3's 1M context holds a whole codebase and keeps working through terminal tools. Zhipu reports 88.2 on Terminal Bench 2.1.

  • 02 · Coding agents

    Claude Code, CI and auto-fix

    Plug GLM into Claude Code or your own agent framework to run tests, read errors and patch code. AnyAIGC does not cap concurrency, so many agents can run at once.

  • 03 · Design to code

    Screenshots to UI

    GLM-5.3-Flash reads images. Hand over a design file or page screenshot and get HTML, CSS or component code back.

  • 04 · Batch jobs

    Classification, extraction and summaries

    GLM-5.3-Flash costs $0.0607 per 1M input tokens, which suits high-volume work like ticket triage, field extraction and long-document summaries.

Quickstart

Connect to the GLM API in three steps

  1. Sign up and add credit: create an account at anyaigc.ai. Top up from $1; your balance works across every model on the platform.
  2. Create an API key: create a key in the console, copy the value that starts with sk-, and store it in the ANYAIGC_API_KEY environment variable.
  3. Send a request: call POST https://anyaigc.ai/v1/chat/completions with model set to glm-5.3 and an Authorization: Bearer header. With the OpenAI SDK, just set base_url to https://anyaigc.ai/v1.
POST /v1/chat/completions
curl https://anyaigc.ai/v1/chat/completions \
  -H "Authorization: Bearer $ANYAIGC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "glm-5.3",
    "messages": [
      {"role": "user", "content": "Explain what a MoE model is in three sentences."}
    ]
  }'
Python · openai SDK
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://anyaigc.ai/v1",
    api_key=os.environ["ANYAIGC_API_KEY"],
)

resp = client.chat.completions.create(
    model="glm-5.3",
    messages=[
        {"role": "system", "content": "You are a senior backend engineer. Answer with runnable code."},
        {"role": "user", "content": "Write an HTTP client in Go with timeouts and retries."},
    ],
)
msg = resp.choices[0].message
print(getattr(msg, "reasoning_content", None))  # reasoning trace, if any
print(msg.content)
print(resp.usage)
Python · stream=True
import os
from openai import OpenAI

client = OpenAI(base_url="https://anyaigc.ai/v1", api_key=os.environ["ANYAIGC_API_KEY"])

stream = client.chat.completions.create(
    model="glm-5.3-flash",
    messages=[{"role": "user", "content": "Write 5 changelog entries for a SaaS product."}],
    stream=True,
)
for chunk in stream:
    if not chunk.choices:
        continue
    delta = chunk.choices[0].delta
    # reasoning_content deltas (if any) arrive first, then the final answer in content
    reasoning = getattr(delta, "reasoning_content", None)
    if reasoning:
        print(reasoning, end="", flush=True)
    if delta.content:
        print(delta.content, end="", flush=True)
print()

Tip: GLM returns its reasoning in the reasoning_content field. When streaming, reasoning deltas arrive first, then the final answer. Set thinking depth with reasoning_effort (low / high / max, default max). In multi-turn chats and tool calls, send the full assistant message from the API (including reasoning_content and tool_calls) back in the next request unchanged.

See the Chat Completions reference for every parameter. Replace the model name in the docs examples with the GLM model ID you want.

Claude Code

Use GLM in Claude Code

Switch Claude Code to GLM by editing one config file, and the coding agent in your terminal runs on GLM-5.3, billed per token.

  1. Install Claude Code: use the official installer, for example curl -fsSL https://claude.ai/install.sh | bash on macOS or Linux.
  2. Add the config: edit ~/.claude/settings.json, add the env block below, and replace ANTHROPIC_AUTH_TOKEN with the key you created on AnyAIGC.
  3. Start coding: run claude in your project folder. Type /model to confirm the current model is glm-5.3.
~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://anyaigc.ai",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-API-key",
    "ANTHROPIC_MODEL": "glm-5.3",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash",
    "API_TIMEOUT_MS": "300000",
    "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1"
  }
}

Save on light tasks: the config sets ANTHROPIC_DEFAULT_HAIKU_MODEL to glm-5.3-flash, so Claude Code's lightweight subtasks use the cheaper model while the main work stays on GLM-5.3.

For the full walkthrough and common errors, see the Claude Code setup guide. Swap the model name in the guide for glm-5.3.

Enterprise

GLM API for teams and enterprises

Teams can top up, issue invoices themselves, and work with a dedicated support and technical contact.

  • Invoices

    Issue them yourself

    Issue an invoice in the console for the amount you actually topped up, whenever you need one.

  • Dedicated support

    Account and technical contacts

    Work with a dedicated support contact and technical engineer for onboarding, migration and troubleshooting.

Payment methods
  • WeChat Pay
  • Alipay
  • USDT
  • Credit card

Why teams trust AnyAIGC

Trial credit, top-ups, refunds, data handling and billing, spelled out up front.

  • 5M free tokens to start

    New accounts get trial credit, so you can test before you top up.

  • Top up from $1, refundable

    Top up from $1. Unused balance can be refunded with no fee.

  • Official channels, real models

    Requests go to official model channels, never cheaper or reverse-engineered substitutes.

  • No retention, no training

    Unless the law requires it, your prompts and outputs are not persistently stored or used for training. See the privacy policy.

  • Transparent billing, spend caps

    See tokens and cost for every request in the console, and set a quota on each API key.

  • 24/7 support

    Contact support any time about integration, billing or incidents.

FAQ

GLM API FAQ

How much does the GLM API cost?

GLM models on AnyAIGC are billed per token. Per 1M tokens: glm-5.3 input $0.9450, output $2.9700, cache hit $0.1758; glm-5.3-flash input $0.0607, output $0.2025, cache hit $0.0122; glm-5.2 input $0.9450, output $2.9700, cache hit $0.2362. GLM-5.3 and GLM-5.2 are about 30% off Zhipu's official USD prices, and GLM-5.3-Flash is about 60% off. See the model catalog for live pricing.

Which GLM models are on AnyAIGC, and what are the model IDs?

This page covers three: glm-5.3 (Zhipu's latest flagship, for complex coding and agents), glm-5.3-flash (the first natively multimodal GLM-5 model, at a low price) and glm-5.2 (the previous flagship, built for long-horizon tasks). Put the model ID in the model field of the request body. Switching models only means changing that one field. Older models such as GLM-5.1, GLM-5 and GLM-4.5 are also on the platform; see the model catalog.

GLM-5.3, GLM-5.3-Flash or GLM-5.2: which should I use?

Pick GLM-5.3 for the hardest coding, terminal and agent work. Pick GLM-5.3-Flash for high-volume, budget-sensitive or image tasks; it costs about 1/15 of GLM-5.3, and Zhipu says it beats GLM-5.2 overall. Stay on GLM-5.2 if you need to turn thinking off or already run it in production. GLM-5.3 and GLM-5.2 cost the same, so new projects should start with GLM-5.3.

Is the GLM API OpenAI compatible?

Yes. All three models use POST https://anyaigc.ai/v1/chat/completions with the same request and response format as OpenAI Chat Completions. With the official OpenAI SDK, set base_url to https://anyaigc.ai/v1. The reasoning trace, if any, comes back in the reasoning_content field.

Can I use GLM in Claude Code?

Yes. In the env block of ~/.claude/settings.json, set ANTHROPIC_BASE_URL to https://anyaigc.ai, ANTHROPIC_AUTH_TOKEN to your API key, and ANTHROPIC_MODEL to glm-5.3. Then run claude. You pay per token, with no 5-hour quota window like a subscription plan.

How large is the context window?

According to Zhipu, GLM-5.3, GLM-5.3-Flash and GLM-5.2 all support a 1M-token context and up to 128K output tokens. GLM-5.3 and GLM-5.2 accept text only; GLM-5.3-Flash also accepts images.

How is this different from the GLM Coding Plan?

The GLM Coding Plan is Zhipu's monthly coding subscription, with quotas that reset on 5-hour and weekly windows. AnyAIGC is a pay-per-token API: you pay for what you use, top up from $1, with no time windows and unlimited concurrency, and the same key calls 300+ other models.

Are GLM models open source? Can I use them commercially?

Zhipu has published the weights for GLM-5.3, GLM-5.3-Flash and GLM-5.2 on Hugging Face. GLM-5.2 and GLM-5.3-Flash use the MIT license; GLM-5.3 uses the GLM-5.3 License, a permissive license with an extra security review clause for very large MaaS companies. Calling the API through AnyAIGC means you do not have to host them yourself. Model licenses and commercial use are governed by Zhipu AI's official terms.

Are there concurrency or rate limits?

AnyAIGC does not cap concurrency for GLM models, and every user gets this by default. That suits batch jobs, CI pipelines and parallel agents. Billing is per token, so there is no quota that resets on a time window like a subscription plan.

How do I get a GLM API key?

Sign up at anyaigc.ai, add credit, and create a key in the console. The same key works for every GLM model and 300+ other models on the platform, so you do not need a separate Zhipu platform account or a GLM Coding Plan.

Can I get an invoice from AnyAIGC?

Yes. You can issue invoices yourself in the console, for the amount you actually topped up.

Which payment methods are supported?

You can top up with WeChat Pay, Alipay, USDT or a credit card. Your balance is in USD and works across every model on the platform. Invoices can be issued in the console for the amount you topped up.

Is there free trial credit for new users?

Yes. New accounts get 5 million tokens of trial credit, so you can test before deciding to top up. Top-ups start at $1.

Can I get a refund on my balance?

Yes. Unused balance can be refunded with no fee. Contact support to start a refund.

Are these the real models? Is my data safe?

Requests go to official model channels, never cheaper or reverse-engineered substitutes. Unless the law requires it, we do not persistently store your prompts or outputs or use them for training, and the console shows tokens and cost for every request.

Will my data be used for training?

No. Except where required by law, AnyAIGC does not persistently store your prompts or outputs and does not use them to train models. Requests are encrypted over HTTPS. See the AnyAIGC Privacy Policy. The model's own data policy is governed by Zhipu AI's official terms.

Run GLM at about 30% off the official price

Sign up, create an API key, and you can use GLM-5.3, GLM-5.3-Flash and GLM-5.2 in your code or Claude Code within minutes.