GLM API
Z.ai GLM API access via RunAPI — MIT-licensed MoE models with up to 200K context, leading open-weight coding benchmarks.
# Base URL
https://runapi.ai
# Endpoints
POST /v1/chat/completions
curl https://runapi.ai/v1/chat/completions \
-H "Authorization: Bearer $RUNAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.1",
"messages": [
{
"role": "user",
"content": "Read this multi-file repository, find the failing integration test, and propose a patch with an explanation of the root cause."
}
]
}'
from openai import OpenAI
client = OpenAI(
base_url="https://runapi.ai/v1",
api_key="your-runapi-key"
)
response = client.chat.completions.create(
model="glm-5.1",
messages=[{"role": "user", "content": "Read this multi-file repository, find the failing integration test, and propose a patch with an explanation of the root cause."}]
)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://runapi.ai/v1",
apiKey: "your-runapi-key"
});
const response = await client.chat.completions.create({
model: "glm-5.1",
messages: [{ role: "user", content: "Read this multi-file repository, find the failing integration test, and propose a patch with an explanation of the root cause." }]
});
GLM is Z.ai's family of MIT-licensed Mixture-of-Experts language models. GLM-4.5 (355B total / 32B active, 128K context) introduced the open-weight MoE line with a flagship and a lighter Air tier. GLM-4.6 and 4.7 extend to 200K context with stronger code generation — 4.7 reaches 73.8% on SWE-bench. The GLM-5 series (744B / 40B active, 200K context) pushes further to 77.8% SWE-bench Verified, and GLM-5.1 holds the top open-weight score on SWE-bench Pro at 58.4%. All are available through RunAPI with one key and per-token billing.
- Variantes para distintos objetivos de calidad y latencia
- API key unificada
- El model skill incluye documentación, schemas y notas de setup
- Las generaciones fallidas no se cobran
Variantes
Endpoints API de GLM
Usa el SDK de OpenAI o Anthropic con tu clave RunAPI. No se necesita SDK adicional.
| Endpoint | Protocol |
|---|---|
| /v1/chat/completions | OpenAI compatible |
Cómo construir con este model skill
Elige el modelo
Selecciona el modelo y la variante que encajan con tu tipo de salida, calidad objetivo y latencia.
Autentica una vez
Usa tu clave RunAPI para todos los modelos compatibles.
Instala el skill
Añade el model skill a tu workspace de código antes de implementar la función.
Recibe la salida
Consulta por task ID o procesa el callback cuando termine la generación.
Dónde encaja GLM
GLM models from Z.ai are MIT-licensed MoE LLMs spanning 128K–200K context. GLM-5.1 leads open-weight models on SWE-bench Pro. Through RunAPI they share a single API key with pay-as-you-go token billing, callable from the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages surfaces.
Por qué usar GLM mediante RunAPI
Una API key
Usa las mismas credenciales entre modelos y proveedores.
Listo para skills
El model skill incluye schemas, notas de setup, contexto de precios e IDs de modelo.
Facturación predecible
El precio por uso es visible antes de llamar.
Preguntas frecuentes
¿Cómo llamo a este modelo?
Instala el model skill y sigue sus notas de setup con tu clave RunAPI.
¿Las generaciones fallidas cuestan dinero?
Las generaciones fallidas no se cobran
¿Puedo llamarlo desde mi aplicación?
Sí. Instala el model skill en tu workspace de código y úsalo mientras añades la función del modelo.