provider
Zhipu GLM
Direct answerDirect GLM access uses https://open.bigmodel.cn/api/paas/v4/, a Bearer API key, and an exact model ID. This gateway uses its own token and guarantees only the adapted paths declared here.
Updated · Reviewed
Direct access versus this gateway
Zhipu's direct OpenAI-compatible base is https://open.bigmodel.cn/api/paas/v4/ and uses a Bearer API key; the current official quickstart uses glm-5.2. This gateway uses its own base URL, Bearer token, and enabled model list. This page declares only /v1/chat/completions; other native or asynchronous Zhipu interfaces are not gateway endpoints.
OpenAI compatibility and model capability
A basic OpenAI SDK migration changes the key, base URL, and model, but multimodal content, reasoning fields, platform tools, and errors still require Zhipu-specific handling. Chat content can represent text, image, audio, video, or files, while exact support remains model-specific. Image and video generation continue to use dedicated APIs.
Tool execution boundary
A function tool normally lets the model propose a name and arguments; the application validates authorization, types, and side effects, executes it, and returns a tool result. Platform tools such as retrieval, web_search, or MCP may be processed by the service and returned as typed results. Clients must distinguish pending local work from an already handled platform result.
Streaming, errors, and limits
A stream can contain content, reasoning_content, tool calls, or platform-tool results, so generic clients must parse fields and event types. Retain request IDs, HTTP status, and business codes to separate authentication, parameters, capability, balance, and limits. Retry only known transient failures with bounded exponential backoff, concurrency caps, and timeouts.
Cost and production checks
Models, plans, concurrency, context, and prices change. Cap output, tool permissions, and search scope, and configure account alerts. Validate modalities, structured output, tool loops, latency, tokens, and recovery on production samples rather than testing only a single text prompt.
Reviewed provider catalog
Latest models by capability
These are provider-catalog models, not a promise of availability on this site. Confirm callable IDs, endpoints, and pricing in the model marketplace.
Text, reasoning, and code
-
glm-5.2Open weightsZhipu's latest flagship with a 1M context window for long-horizon coding, reasoning, and agentic tasks.
-
glm-5.1Open weightsA stable flagship tier for long-running agents and engineering-oriented coding.
-
glm-5-turboStableA faster model optimized for continuous execution of complex, long-running tasks.
Image generation and editing
-
glm-imageOpen weightsThe flagship image model with stronger complex-instruction following and Chinese/English text rendering.
-
cogview-4StableA general high-quality image generation model with multiple output resolutions.
Video generation and editing
-
cogvideox-3StableThe flagship video model supporting text, image, and first/last-frame inputs.
Speech and audio
-
glm-realtimeStableA realtime audio-video model with long-conversation memory and cross-modal reasoning.
-
glm-ttsStableA natural speech synthesis model supporting streaming and non-streaming output.
Embeddings, retrieval, and reranking
-
embedding-3StableZhipu's V3 text embedding model for semantic search, clustering, and RAG.
-
rerankStableA reranking model that scores query-document relevance and reorders candidates.
Use cases
- Agentic and coding tasks
- Long-context reasoning
- Vision and image generation
API protocols
/v1/chat/completions
FAQ
How do I migrate an OpenAI SDK to direct Zhipu GLM access?
A basic migration changes api_key, base_url=https://open.bigmodel.cn/api/paas/v4/, and model; the current official quickstart uses glm-5.2. Through this gateway, use the gateway base URL, token, and enabled model name instead of a Zhipu key.
Must the client execute GLM function, web_search, retrieval, and MCP tools?
They have different boundaries. A function normally returns a name and arguments for the application to validate and execute. Web search, retrieval, or MCP may be handled by the Zhipu platform and returned as typed results. Inspect the response type to avoid missing or duplicating execution.
Why can one GLM model accept images or tools while another cannot?
The chat schema can represent text, image, audio, video, files, and several tool types, but the exact model defines the supported matrix. Never infer modalities or tools from the GLM brand alone; check the model overview and model-specific page.
How should I diagnose streaming and rate-limit failures?
Retain the request ID, HTTP status, and provider business code, then distinguish authentication, parameters, model capability, balance, and rate limits. A streaming client must also consume terminal events and error blocks; use bounded exponential backoff only for retryable failures.
Related guides
Official sources
- Zhipu Model Overview Official
- Zhipu Chat Completions API Official
- Zhipu Quickstart Official
- Zhipu OpenAI SDK Compatibility Official
- Zhipu API Error Codes Official
- Zhipu API Rate Limits Official
兔子API