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 diferentes metas de qualidade e latência
- API key unificada
- O model skill inclui documentação, schemas e notas de setup
- Gerações com falha não são cobradas
Variantes
Endpoints da API GLM
Use o SDK OpenAI ou Anthropic com sua chave RunAPI. Nenhum SDK extra necessário.
| Endpoint | Protocol |
|---|---|
| /v1/chat/completions | OpenAI compatible |
Como construir com este model skill
Escolha o modelo
Selecione o modelo e a variante que combinam com seu tipo de saída, meta de qualidade e latência.
Autentique uma vez
Use sua chave RunAPI para todos os modelos compatíveis.
Instale o skill
Adicione o model skill ao workspace de código antes de implementar a funcionalidade.
Receba a saída
Consulte por task ID ou trate o callback quando a geração terminar.
Onde GLM se encaixa
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 que usar GLM pela RunAPI
Uma API key
Use as mesmas credenciais entre modelos e provedores.
Pronto para skills
O model skill inclui schemas, notas de setup, contexto de preços e IDs de modelo.
Cobrança previsível
O preço por uso fica visível antes da chamada.
Perguntas frequentes
Como chamo este modelo?
Instale o model skill e siga as notas de setup com sua chave RunAPI.
Gerações com falha custam dinheiro?
Gerações com falha não são cobradas
Posso chamar a partir da minha aplicação?
Sim. Instale o model skill no workspace de código e use durante a implementação da funcionalidade.