This guide describes how to setup opencode to be able to request api.mammouth.ai as the models provider.
Download OpenCode TUI https://opencode.ai
Create/Update your
~/.config/opencode/opencode.jsonc file [Tested on Linux]C:\\Users\\<you>\\.config\\opencode\\opencode.jsonc fileso that it contains the litellm provider like so:
{
"$schema": "<https://opencode.ai/config.json>",
"provider": {
"litellm": { // we use open-source LiteLLM to create our API
"npm": "@ai-sdk/openai-compatible",
"options": {
"apiKey": "sk-***", // your API key you created on <https://mammouth.ai/app/account/settings/api> goes there
"baseURL": "<https://api.mammouth.ai/v1>",
},
// You can rename models here to make sure it comes from this configuration
// all models can be found in the list at <https://api.mammouth.ai/models>
"models": {
"gpt-4.1": {
"name": "GPT 4.1 (mammouth.ai)"
},
"claude-4-sonnet-20250522": {
"name": "Claude 4 Sonnet (mammouth.ai)"
}
}
},
},
}
opencode and input /models . Search for Claude 4 Sonnet (mammouth.ai) for example. Start coding !Note
Both opencode.jsonc and opencode.json are valid configuration files. JSONC is just JSON with the ability to add comments // like this in it.