OpenCode · Gatelum
OpenCode describes the provider in opencode.json; the key lives there too.
Example setup
- Base URL
https://api.gatelum.com/v1- Your API key
glt_YOUR_KEY
Install with one command
One command writes the gateway address, your key and the default models into the tool config. Existing files are backed up first.
curl -fsSL https://gatelum.com/install.sh | sh -s -- --key glt_YOUR_KEYPrefer to set it up yourself? The manual steps are right below.
Connection steps
Put the provider block into opencode.json, whether that file sits in the project or under ~/.config/opencode/ for your user (Windows path: %USERPROFILE%\.config\opencode\).
Check that apiKey contains the full key in quotes. This config does not read .env or environment variables.
Restart OpenCode completely and pick the model with /models.
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"gatelum": {
"npm": "@ai-sdk/openai-compatible",
"name": "Gatelum",
"options": {
"baseURL": "https://api.gatelum.com/v1",
"apiKey": "glt_YOUR_KEY"
},
"models": {
"z-ai/glm-5.3-flash": { "name": "GLM-5.3 Flash" }
}
}
}
}Connection check
Send one short request: it checks the key, the address and the chosen model.
curl https://api.gatelum.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer glt_YOUR_KEY" \
-d '{"model":"z-ai/glm-5.3-flash","messages":[{"role":"user","content":"ping"}]}'A normal answer means the setup is correct. 401 points to the key, 404 to the address or model, 400 to the request format.
functions. JSON output (response_format) is accepted on OpenAI-compatible routes, while a model reachable only through a direct Anthropic or Google connection answers unsupported_capability. The retired functions format behaves differently: it returns parameter_not_supported, so no parameter disappears without an explanation. Only models the catalog tags "Understands images" may accept pictures — they travel as an image_url part holding a data:image/png;base64,… address (PNG, JPEG and WebP are allowed, a file may weigh up to 5 MB, and a request carries at most 50). Remote addresses are never downloaded, while a model lacking the tag answers bad_request. Each error, bad_request as well as parameter_not_supported, states the reason plainly.