Call GPT generation and OpenAI text embedding models through RunAPI using OpenAI-compatible clients. Use for chat, Responses, embeddings, streaming, tools, vision, or an existing compatibility client that needs the conditional reference.
编程
glm
试用Call the GLM API (GLM 5 and 4 series) through RunAPI using OpenAI-compatible Chat Completions. Use for GLM text chat, streaming, or an existing compatibility client that needs the conditional reference.
它能做什么
Call the GLM API (GLM 5 and 4 series) through RunAPI using OpenAI-compatible Chat Completions. Use for GLM text chat, streaming, or an existing compatibility client that needs the conditional reference.
技能文档
GLM on RunAPI
Use OpenAI-compatible Chat Completions at https://runapi.ai/v1 as the primary protocol.
Primary protocol recipe
Authenticate
Set OPENAI_API_KEY to a RunAPI API key and OPENAI_BASE_URL to https://runapi.ai/v1.
Send request
from openai import OpenAI
client = OpenAI(api_key="YOUR_RUNAPI_TOKEN", base_url="https://runapi.ai/v1")
response = client.chat.completions.create(
model="glm-5.2",
messages=[{"role": "user", "content": "Summarize this review."}],
)
print(response.choices[0].message.content)
print(response.usage)
For long output, call the same method with stream=True and
stream_options={"include_usage": True}; consume every chunk through [DONE].
Verify result
Require final assistant content, a terminal finish_reason, and authoritative
usage. A stream is complete only after its terminal usage chunk and [DONE].
Stop boundaries
Correct a rejected shape once using the structured error. Retry transport once
only before any response or Usage and when replay is safe. Record a terminal
error and stop without changing model or protocol. For glm-5.2, start with
text history; add tools, reasoning, structured output, or multimodal input only
when the current RunAPI contract explicitly verifies that capability.
Compatibility protocols
Load compatibility protocols only when an existing client requires Anthropic Messages or Gemini contents.
Supported models
| Model ID | Use when |
|---|---|
glm-5.2 | Current flagship text workloads |
glm-5.1 | Recent GLM chat workloads |
glm-5-turbo | Faster GLM chat |
glm-5 | General GLM 5 requests |
glm-4.7 | GLM 4.7 compatibility |
glm-4.6 | Stable GLM 4.6 requests |
glm-4.5 | GLM 4.5 compatibility |
glm-4.5-air | Lightweight GLM 4.5 requests |
References
相关技能
Call the Qwen text API (qwen3-next-80b-a3b-instruct) through RunAPI using the official OpenAI SDK or compatible clients. Use when the user asks for Qwen text...
Use the AutoGLM Upload Mix API to upload local files such as images and documents, then obtain a file URL or resource ID for downstream API calls. The token...
Call Gemini 2.5 and 3 series models through RunAPI using Gemini contents clients. Use for Gemini chat, streaming, multimodal input, grounding, structured output, reasoning, or an existing compatibility client that needs the conditional reference.
Create Gemini Omni voice resources, character resources, and Flash Preview or multimodal text-to-video tasks through RunAPI. Use when the user asks an agent to create or manage Gemini Omni audio voices, character resources, or video. Default to the RunAPI CLI for one-off calls; use SDKs only when integrating RunAPI into an app or backend.
Use when the user asks what RunAPI models are available, compares models, needs pricing, asks for required fields, searches by modality, or wants a recommend...