IDE & Client Setup
Point any OpenAI-compatible SDK, IDE client, or coding agent at the GLM 5 base URL, then verify the connection and trace a request by its X-Request-ID.
What "IDE support" means
GLM5 exposes an OpenAI-compatible API. Use it inside VS Code or another IDE through a client or coding agent that supports a custom OpenAI-compatible provider.
This documentation does not claim that GLM5 ships a first-party VS Code extension.
Every client needs these three values together:
Verify the key before configuring an IDE
curl https://glm5.app/api/v1/models \
-H "Authorization: Bearer $GLM5_API_KEY"
Then make a small Chat Completions request. If both calls work but the IDE returns 401, check that the client is using a custom provider and that its Base URL is exactly https://glm5.app/api/v1.
OpenAI SDK
import OpenAI from 'openai';
const client = new OpenAI({
apiKey: process.env.GLM5_API_KEY,
baseURL: 'https://glm5.app/api/v1',
});
const result = await client.chat.completions.create({
model: 'glm-5.3-flash',
messages: [{ role: 'user', content: 'Hello' }],
});
OpenCode
Use @ai-sdk/openai-compatible, set baseURL to GLM5, and supply your key through an environment variable. Add the GLM5 public model IDs you intend to use.
Oh My Pi (omp)
For omp, define a custom provider in ~/.omp/agent/models.yml:
providers:
glm5:
baseUrl: https://glm5.app/api/v1
api: openai-responses
apiKey: GLM5_API_KEY
models:
- id: glm-5.3-flash
name: GLM 5.3 Flash
contextWindow: 1000000
maxTokens: 8192
Set GLM5_API_KEY in the same shell, then run omp models glm5 to verify the
provider. To make it the default model, set modelRoles.default to
glm5/glm-5.3-flash in ~/.omp/agent/config.yml.
Pi / Continue / other clients
Choose the client's custom OpenAI-compatible provider mode. Do not select a built-in OpenAI provider that hardcodes api.openai.com unless the client lets you override the Base URL.
Do not paste the key alone
A valid GLM5 key sent to the wrong Base URL can still produce a 401. Configure Base URL + API key + Model ID as one setup task.
Troubleshooting
After a GLM5 API request reaches the service, responses include X-Request-ID. Open Activity → Logs and search that ID to inspect status, model, key, tokens, credits, latency, and error code without exposing prompt text.