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

Image generation and editing

Video generation and editing

Speech and audio

Embeddings, retrieval, and reranking

Check live availability in the model marketplace

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.

Official sources

  1. Zhipu Model Overview Official
  2. Zhipu Chat Completions API Official
  3. Zhipu Quickstart Official
  4. Zhipu OpenAI SDK Compatibility Official
  5. Zhipu API Error Codes Official
  6. Zhipu API Rate Limits Official