Coding tools

OpenCode

The open-source coding agent for the terminal, with Unaligned as a provider.

Setup

Add Unaligned as a provider in ~/.config/opencode/opencode.json (every project) or in an opencode.json at the root of one project. List the models you want to use, with their limits from the model list:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "unaligned": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Unaligned",
      "options": {
        "baseURL": "https://api.unaligned.pw/openai/v1",
        "apiKey": "{env:UNALIGNED_KEY}"
      },
      "models": {
        "claude-sonnet-5-5": { "name": "Claude Sonnet 5.5", "limit": { "context": 1000000, "output": 64000 } },
        "glm-5.3": { "name": "GLM 5.3", "limit": { "context": 1000000, "output": 65536 } },
        "deepseek-v4.1-flash": { "name": "DeepSeek V4.1 Flash", "limit": { "context": 1000000, "output": 65536 } }
      }
    }
  },
  "model": "unaligned/claude-sonnet-5-5",
  "small_model": "unaligned/deepseek-v4.1-flash"
}
  • npm must be @ai-sdk/openai-compatible, the package for OpenAI-compatible providers (@ai-sdk/openai is for OpenAI itself).
  • model is provider/model: the key under provider, then the key under models.
  • small_model handles titles and other small tasks: a cheap model is enough.
  • {env:UNALIGNED_KEY} reads the key from the environment. You can also store it with /connect → Other → provider ID unaligned, and leave apiKey out.

Switching models

Run /models in OpenCode, or start it with opencode -m unaligned/${OPEN}. A model must be listed under models to appear.