This guide describes how to setup opencode to be able to request api.mammouth.ai as the models provider.

  1. Download OpenCode TUI https://opencode.ai

  2. Create/Update your

    1. (if you’re on Linux or Mac) ~/.config/opencode/opencode.jsonc file [Tested on Linux]
    2. (if you’re on Windows) C:\\Users\\<you>\\.config\\opencode\\opencode.jsonc file

    so 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)"
                }
            }
        },
      },
}

  1. Run 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.