OpenCode

How to route OpenCode through Aramm with a minimal project config.

OpenCode works with Aramm when you point its OpenAI-compatible provider at the Aramm gateway and use an Aramm provider/model id.

What you need

  • An Aramm API key
  • OpenCode installed locally
  • A model id such as anthropic/claude-sonnet-4-6

Quick setup

Create or edit opencode.json in your project root or ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "anthropic/claude-sonnet-4-6",
  "provider": {
    "aramm": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Aramm",
      "options": {
        "baseURL": "https://router.aramm.ai/v1",
        "apiKey": "{env:ARAMM_API_KEY}"
      }
    }
  }
}

Then export your key:

export ARAMM_API_KEY="your_aramm_api_key"
opencode

Verify it works

Run a prompt in OpenCode and confirm the first request completes without auth or model errors.

Troubleshooting

  • 401 usually means the API key is missing or invalid.
  • model not found usually means the model id does not match Aramm's format.
  • If the request fails immediately, confirm the base URL ends with /v1.

On this page