Opennan
Zurück zum Blog

GLM-4.7 API: Pricing, Quickstart, and OpenAI-Compatible Endpoint

GLM-4.7 on Opennan costs $0.52 per million input tokens and $2.20 per million output tokens, with an OpenAI-compatible endpoint you can call in minutes.

Cover: AI-generated editorial illustration.

Evergreen guide. Prices and details checked on 11 November 2026 against the linked pages; prices can change, so check them before you buy.

GLM-4.7 is live on the Opennan API at $0.52 per million input tokens, $0.104 per million cached input tokens, and $2.20 per million output tokens, according to the GLM-4.7 model page. The endpoint uses the OpenAI Chat Completions format, so you can call it by swapping the base URL in code you already have.

GLM-4.7 API prices compared to the maker's rate

Opennan publishes its prices side by side with Z.ai's own list price so you can see the difference on every line. Input tokens are 13% below the maker's official rate. Output tokens match the maker's price. Cached input tokens are below the maker's rate; the model page does not state Z.ai's exact cached input price.

Price typeOpennanZ.ai official
Input, per 1M tokens$0.52$0.60
Cached input, per 1M tokens$0.104Not published on the model page
Output, per 1M tokens$2.20$2.20

Prices on the model page were last checked on 16 October 2026. You can also see GLM-4.7 listed alongside every other text model on the Opennan pricing page.

What a call actually costs

Billing splits into three separate line items: input tokens, cached input tokens, and output tokens. Each is charged per million tokens at its own rate.

To illustrate using the rates above: a 50,000-token prompt costs $0.52 × 0.050 = $0.026 in input tokens, and a 2,000-token reply costs $2.20 × 0.002 = $0.0044 in output tokens, totalling $0.0304 for that exchange. These are the confirmed per-million rates from the model page applied to example token counts.

If part of the prompt is served from the cache, those tokens are billed at $0.104 per million instead of $0.52. On long, repeated system prompts that saving adds up quickly.

The model page shows an estimated cost before you run a call. The X-Usage-Cost-Usd response header records what the call actually cost. Every reply's usage object also includes a cost_usd field.

Quickstart: your first call

GLM-4.7 uses the same endpoint as every other text model on Opennan. Change the base URL to https://api.opennan.com/v1 and use your Opennan key. The rest of your OpenAI-compatible code needs no changes.

Endpoint: POST https://api.opennan.com/v1/chat/completions

Model field: glm-4.7

The model page shows the full request the browser tool sends:

curl -N https://api.opennan.com/v1/chat/completions -H "Authorization: Bearer $OPENNAN_KEY" -H "Content-Type: application/json" -d '{"model":"glm-4.7","messages":[{"role":"user","content":"Write a haiku about a city at night."}],"max_tokens":1024,"temperature":1,"top_p":1,"stream":true,"stream_options":{"include_usage":true}}'

Create a key in the console under Access → Full API. The key starts with sk- and uses the same balance as the website. Set it as OPENNAN_KEY in your environment and keep it private.

If you use an AI coding tool, the Chat API page shows how to add the Opennan MCP server at https://api.opennan.com/v1/mcp for Codex, Claude Code, Cursor, VS Code, and others. One install gives your AI every Opennan model and tool under a single key.

Parameters GLM-4.7 accepts

The model page lists every field the API accepts. Fields not on this list return a 400 error; the error message names the rejected field.

  • model (required): glm-4.7
  • messages (required): the conversation as role and content pairs
  • max_tokens (optional): 1 to 131,072; defaults to 16,384; billed per token written
  • temperature (optional): higher values give more varied answers
  • stream (optional): delivers the answer token by token as it is written
  • tools (optional): functions the model may call

The API docs note that tools and tool_choice require a model with tools: true in its catalog entry. Use GET /v1/models?category=text to check the current supported parameters for GLM-4.7.

Billing and failed requests

The model page states that a request that fails is not charged. You pay only for the tokens used. The API docs add that a call failing before the first token is not charged at all. If you disconnect or the reply stops part-way, you pay for the prompt and the tokens already sent.

When a call starts, Opennan holds the prompt estimate plus your max_tokens value from your balance, then charges real usage and returns the rest. The docs recommend streaming for long outputs, since a non-streamed reply is cut at 9 minutes and a stream at 20 minutes, with the charge covering what was produced.

FAQ

Is the GLM-4.7 endpoint OpenAI-compatible?

Yes. It uses the OpenAI Chat Completions format. Set base_url to https://api.opennan.com/v1, use your Opennan key, and change model to glm-4.7. The OpenAI Python and JavaScript SDKs work without other changes, as the API docs confirm.

Is there a free tier for GLM-4.7?

The model page and docs do not describe a free tier for GLM-4.7. The docs note that listing models needs no key, but generating a reply requires a key and a balance. The browser tool on the model page lets you preview output before writing any code.

How does cached input billing work?

Cached input tokens are billed at $0.104 per million, separately from standard input tokens at $0.52 per million, as shown on the model page. The page shows all three line items: input, cached input, and output. It does not describe the caching mechanism further, only the price difference.

What is the context length?

The GLM-4.7 model page shows a context window of 203K tokens (202,752 tokens). The maximum output per reply is up to 131,072 tokens, controlled by the max_tokens parameter.

Does GLM-4.7 support tool use?

The model page lists tools as an accepted parameter. The API docs state that tool use requires a model with tools: true in the catalog. Verify this for the current build with GET /v1/models?category=text before relying on it in production.

To try GLM-4.7 now, open the GLM-4.7 page on Opennan for the live model, prices, and copy-ready code samples. The same API key and balance cover every other model on the platform, including video, image, voice, and music tools, so there is no separate account or signup needed to explore further.

Wir verwenden nur die Cookies, die die Website braucht, etwa für deine Sprache und einen Empfehlungscode. Keine Werbung. Seitenaufrufe zählen wir mit einer Analyse ohne Cookies. Details findest du in unserer Cookie-Richtlinie .