Adding more models to OpenCode: the models block and the id with the slash

Coding with AIOpenCode·· 15 views· 4 min read

For your own provider, OpenCode only shows the models written in the models block of the file. To have another All in One AI model in /models, add a line for it. Here is how, without breaking the JSON.

What a line looks like

"zai-org/glm-5.2": { "name": "GLM 5.2", "limit": { "context": 1048576, "output": 16000 } }

Part What it is
"zai-org/glm-5.2" The catalogue id, exactly as it is, with the slash. This is what goes to our API.
name The name you see in /models. You can write anything you like.
limit The context and the maximum per answer. They are explained in context and output limits in OpenCode.

Adding the line

1 Open the file: the global one or the project one.
2 Find "models", inside the Interweb provider.
3 Put a comma at the end of the last line in it and paste the new line below. If the new one is the last, it has no comma.
4 Save, close OpenCode and open it again. Type /models and choose the new model.

The block ends up like this, with four models:

"models": {
"moonshotai/kimi-k2.7-code": { "name": "Kimi K2.7 Code", "limit": { "context": 262144, "output": 16000 } },
"deepseek-ai/deepseek-v4-pro": { "name": "DeepSeek V4 Pro", "limit": { "context": 1048576, "output": 16000 } },
"zai-org/glm-5.2": { "name": "GLM 5.2", "limit": { "context": 1048576, "output": 16000 } },
"deepseek-ai/deepseek-v4-flash": { "name": "DeepSeek V4 Flash", "limit": { "context": 1048576, "output": 16000 } }
}

In a .jsonc file, a comma after the last item is accepted. In a .json file it is not, and OpenCode does not read the file.

The id with the slash

Every catalogue id has a slash, such as moonshotai/kimi-k2.7-code. In models, write it whole. Without the first part (just kimi-k2.7-code), the API answers 404 model_not_found.

To choose the model, OpenCode puts the provider in front: api/moonshotai/kimi-k2.7-code. It cuts at the first slash. What comes before is the provider; the rest is the model, with its own slash. Capital letters count, so copy the ids exactly as they are.

The ids are in the Models tab of All in One AI or in the API list. On Linux and macOS:

curl "https://api.interweb.co.mz/v1/models?type=text" -H "Authorization: Bearer $INTERWEB_API_KEY"

In Windows PowerShell:

curl.exe "https://api.interweb.co.mz/v1/models?type=text" -H "Authorization: Bearer $env:INTERWEB_API_KEY"

Each model comes with its id (always with the slash), its context_length and its price in pricing. Listing the models spends no credits.

Which models to add

Use text models that support tools (function calling). OpenCode needs them to edit files and run commands:

Model Context What for
moonshotai/kimi-k2.7-code 262,144 tokens Built for coding: the starting point for everyday work.
deepseek-ai/deepseek-v4-pro 1,048,576 tokens Strong reasoning, for big changes and hard bugs.
zai-org/glm-5.2 1,048,576 tokens Made for agents: handles tools well in long tasks.
deepseek-ai/deepseek-v4-flash 1,048,576 tokens Fast and cheap, for background tasks and short questions.

The block in OpenCode with All in One AI already has the 79 models that support tools, from the most expensive to the cheapest. You can copy it whole and delete the lines you do not use. The price of each model is in the Models tab of All in One AI.

Want more models in OpenCode? Visit the Coding with AI page.

See Coding with AI

SEE ALSO

OpenCode with All in One AI: creating opencode.json from scratch, the key and the models

Choosing the model in OpenCode: /models and the provider/model format

Context and output limits in OpenCode: limit.context and limit.output

Errors when setting up a tool with All in One AI: 401, model not found, no credits, /v1 and rejected config files

Coding with AI in All in One AI

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $5.36/mo (3-year plan, with coupon)

See plans
Was this answer helpful? Your answer helps us improve this article.