glm api
GLM API: choose speed, generation, or vision on purpose
“GLM API” searches fail when every Zhipu name lands in one paragraph. This hub forces a speed vs quality vs vision decision, then verifies Live vs Integrating before you paste an ID into production.
Map workload to Flash, 5.x text, or 5V vision — then verify whether that row is Live or still Integrating.
2 Live · 2 Integrating · Base URL https://thesmartoken.com/v1
Reading Z.ai rows without vendor fog
Zhipu / Z.ai naming shifts across consoles, blogs, and gateway aliases. Your production config should not depend on nickname archaeology — only on apiModelId values from this catalog or GET /v1/models.
glm-4-flash is the latency/cost oriented entry for snappy assistants and classification-like tasks. Measure p95 latency before chasing newer 5.x names.
glm-5.2 and glm-5.3 are newer text candidates when Flash quality ceilings show up. Promote the smallest upgrade that clears your gate.
glm-5v-turbo is vision-oriented. Sending images to a text-only ID and calling it a “GLM failure” wastes a week.
DeepSeek currently carries Live canaries on SmarToken for many teams. Use GLM when your eval says Flash/5.x/5V wins on the workloads you ship — especially Chinese enterprise-style assistants — not because the brand feels safe.
Catalog rows for this vendor
Flash vs 5.x vs Vision
| Dimension | Speed / cost (Flash) | Quality / vision upgrades |
|---|---|---|
| Default probe | glm-4-flash | glm-5.2 / 5.3 or glm-5v-turbo by need |
| Optimize for | Latency and unit cost | Harder text quality or image inputs |
| Risk if wrong | Quality ceiling on hard tasks | Paying more when Flash already passed |
| Vision? | No — text-oriented | 5V Turbo only for image loops |
Workload → first pick
| Workload | First pick | Why |
|---|---|---|
| Interactive assistants | glm-4-flash | Prove p95 and error rate before upgrading. |
| Harder reasoning / writing | 5.2 / 5.3 bake-off | Smallest upgrade that clears the gate wins. |
| Screenshots / docs as images | glm-5v-turbo | Vision fixtures only — do not mix scoring. |
| OpenRouter alias cleanup | Map to catalog IDs | See /openrouter-alternative; stop billing aliases forever. |
GLM decision tree
Step 1
Need interactive latency → Flash
Measure p95 and errors on top intents before chasing 5.x.
Step 2
Flash fails quality → 5.2 / 5.3
Identical prompts. Promote the smallest upgrade that passes.
Step 3
Images in the loop → 5V Turbo only
Confirm vision capabilities in docs for your parameters.
Step 4
Normalize aliases → catalog IDs
Long-term logs and invoices should show SmarToken model IDs.
Billing notes
Flash traffic should be cheap per turn — if it is not, inspect prompt bloat before upgrading models.
Vision tokens and image payloads change cost curves; forecast with real fixtures.
Integrating rows are not production invoice lines until Live usage appears in the wallet.
Cross-check /pricing and this hub’s status column on every release.
Minimal request shape
Default example uses glm-4-flash. Switch explicitly if bake-off selected 5.x or 5V. Current example ID: glm-5.2 (Live).
const client = new OpenAI({
apiKey: process.env.SMTOKEN_API_KEY,
baseURL: "https://thesmartoken.com/v1",
});
const result = await client.chat.completions.create({
model: "glm-5.2",
messages: [{ role: "user", content: "Return one sentence confirming the model id." }],
});Full protocol notes live in /docs#quickstart. Confirm Live IDs with GET /v1/models before raising concurrency.
Ops notes
- Keep Zhipu-direct and SmarToken keys labeled separately.
- When quality drops, check which generation ID logs show — alias maps drift.
- Vision failures: verify payload encoding before swapping models again.
- 402 handling: stop retries, top up, resume — same as other Live routes.
GLM pitfalls
- Confusing Zhipu console IDs with SmarToken apiModelId values.
- Using OpenRouter-style aliases forever instead of catalog IDs.
- Judging vision models with text-only benchmarks.
- Ignoring Integrating status because GLM branding feels enterprise-safe.
- Upgrading to 5.x without proving Flash failed the gate.
When another page is better
- Live DeepSeek canary — /models/deepseek.
- Long-context Moonshot story — /models/kimi.
- Alias migration playbook — /openrouter-alternative.
Internal and external links
Use internal links for SmarToken decisions and billing. Use external links for upstream vendor truth — then reconcile both before you forecast spend.
Internal links
- OpenRouter alternative
Alias → catalog ID
- DeepSeek hub
Live baseline
- Kimi hub
Long-context alternative
- USD billing
Wallet narrative
- Gateway pricing
Full table
- Docs quickstart
Request shape
- Model plaza
Compare dock
External references
- Z.ai docs
Official Z.ai / GLM documentation entry
External pages change. Treat them as vendor references; SmarToken billable USD rates and Live status on this site remain the customer-facing source of truth.
FAQ
- Is Z.ai the same as Zhipu here?
- For filtering, yes — this hub uses vendorFilter Z.ai. Cards still show the human vendor label from the catalog.
- Should GLM replace DeepSeek for me?
- Only if your eval says so. DeepSeek currently carries Live canaries; GLM may still be Integrating depending on the row.
- Where do aliases get normalized?
- See /openrouter-alternative. Long term, log and bill against the SmarToken model ID.
- Flash or 5.x for a new chatbot?
- Start Flash. Upgrade only when measured quality gates fail.