Quickstart
Send your first GLM 5 API request — create a key, call chat completions over HTTP or the OpenAI SDK, then connect Codex, OpenCode, Cursor, or Continue.
Quickstart
Get started with GLM 5.
GLM 5 exposes OpenAI-compatible Chat Completions and Responses APIs through one base URL. Choose the integration style that fits your application:
| Approach | Best for |
|---|---|
| Direct API | Full control, any language, no SDK dependency |
| OpenAI SDK | Existing Python or TypeScript apps using the OpenAI client |
| Coding clients | Codex, OpenCode, OMP, Cursor, Continue, and other developer tools |
Before you start
Create a key on API Keys. The full sk-glm5-... value is
shown once, so save it in a secret store or password manager.
Using the GLM 5 API
Send standard HTTP requests to https://glm5.app/api/v1/chat/completions. Authenticate with a bearer API key and use a model ID returned by GET /models.
import os
import requests
response = requests.post(
"https://glm5.app/api/v1/chat/completions",
headers={
"Authorization": f"Bearer {os.environ['GLM5_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "glm-5.3-flash",
"messages": [
{"role": "user", "content": "Explain why the sky is blue in one paragraph."}
],
},
)
print(response.json()["choices"][0]["message"]["content"])
The APIs support streaming and function calling on supported models. See Chat Completions and Client Integrations for request schemas and setup details.
Using the OpenAI SDK
Point the standard OpenAI client at the GLM 5 base URL. Your application can keep the familiar chat.completions.create interface.
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.GLM5_API_KEY,
baseURL: 'https://glm5.app/api/v1',
});
const completion = await client.chat.completions.create({
model: 'glm-5.3-flash',
messages: [
{ role: 'user', content: 'Write a hello-world function in TypeScript.' },
],
});
console.log(completion.choices[0]?.message?.content);
Using coding clients
Developer tools differ in how they accept custom model providers. Use the dedicated integration guide instead of guessing provider fields.
Codex Desktop / CLI
Connect Codex through the Responses-compatible GLM5 provider.
OpenCode
Direct OpenAI-compatible provider setup with GLM 5.
Oh My Pi (omp)
Configure the GLM5 OpenAI-compatible provider for omp.
Cursor
Use GLM 5 where your Cursor version supports a custom OpenAI-compatible endpoint and model ID.
Claude Code
Claude Code uses the Anthropic protocol; connect through an Anthropic-compatible translating gateway.
Continue and other clients
Configuration examples for additional OpenAI-compatible developer clients.
Building with an AI assistant
If you want an AI coding assistant to configure your local tool, give it the connection values below and ask it to inspect the exact version installed on your machine before changing configuration.
Help me configure GLM5 in my coding tool.
Connection values:
- Base URL: https://glm5.app/api/v1
- Model: glm-5.3-flash
- API key: keep it local in GLM5_API_KEY or the tool's secure credential store
Requirements:
1. Inspect my installed client/version before changing anything.
2. Use its supported custom-provider configuration.
3. Never ask me to paste the API key into chat or commit it to source control.
4. Preserve my existing configuration.
5. If the client cannot use a custom OpenAI-compatible endpoint, explain the limitation and recommend a compatible path.
Keep secrets local
The prompt intentionally does not contain your real API key. Enter the key only in a local environment variable or the client's credential store.