> For the complete documentation index, see [llms.txt](https://docs.obitmc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.obitmc.com/inference-api/use-with/opencode.md).

# opencode

Use Obit's models from opencode by declaring a custom OpenAI-compatible provider.

opencode takes its provider list from [models.dev](https://models.dev), where an Obit listing is still pending, so declare Obit as a custom provider in `opencode.json` (your project root) or `~/.config/opencode/opencode.json` (everywhere):

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "obit": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Obit",
      "options": {
        "baseURL": "https://relay.obitmc.com/v1",
        "apiKey": "{env:OBIT_API_KEY}"
      },
      "models": {
        "unsloth/Qwen3.8-27B-GGUF": {
          "name": "Qwen3.8 27B",
          "limit": { "context": 262144, "output": 262144 }
        }
      }
    }
  }
}
```

Then `export OBIT_API_KEY=sk-live-…` and pick the model as `obit/unsloth/Qwen3.8-27B-GGUF`.

**Note.** A model you do not list does not exist to opencode, and `limit.context` is what it plans against, so write the model's real context window. Keep `@ai-sdk/openai-compatible`: `@ai-sdk/openai` drives the provider through `/v1/responses`, which Obit also serves.

*Verified against* [*opencode.ai/docs/providers*](https://opencode.ai/docs/providers/) *and* [*opencode.ai/docs/config*](https://opencode.ai/docs/config/) *on 2026-09-22.*

***

[Prices](https://obitmc.com/pricing) · [Status](https://status.obitmc.com) · [API reference](/inference-api/inference-api.md)
