All integrations
🛠️

OpenCode

Open-source terminal coding agent — provider-agnostic, point it anywhere

Protocol: BothLast verified 2026-05-19

OpenCode is a terminal-native coding agent in the spirit of Claude Code, with a pluggable provider model. Its config supports any OpenAI- or Anthropic-compatible endpoint, including clawfeeder.

Prerequisites

OpenCode installed (see opencode.ai), and a clawfeeder API key.

Steps

1Locate OpenCode config

Config lives at ~/.config/opencode/config.json on Linux/macOS, %APPDATA%/opencode/config.json on Windows. Create the file if missing.

2Add clawfeeder as a provider

Add a 'clawfeeder' entry under provider, pointing at the OpenAI-compatible endpoint. Each model you intend to use must be listed under models with a label.

{
  "provider": {
    "clawfeeder": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "clawfeeder.ai",
      "options": {
        "baseURL": "https://clawfeeder.ai/v1",
        "apiKey": "cf-sk-***your_key***"
      },
      "models": {
        "claude-sonnet-4-6": { "name": "Claude Sonnet 4.6" },
        "claude-opus-4-7":   { "name": "Claude Opus 4.7" },
        "gpt-5.2":           { "name": "GPT-5.2" }
      }
    }
  }
}

3Select a model

Launch opencode and use the /model command (or the picker UI) to choose clawfeeder/claude-sonnet-4-6 or any other model you registered. The first segment is the provider id, the second is the model id.

opencode
# inside the CLI:
/model clawfeeder/claude-sonnet-4-6

4Start a task

Type any coding task. OpenCode will route every model call through clawfeeder; watch /dashboard for credit deduction in real time.

Verify

Confirm clawfeeder accepts your key with the openai-compatible model name OpenCode uses.

curl -X POST "https://clawfeeder.ai/v1/chat/completions" \
  -H "Authorization: Bearer cf-sk-***" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4-6","messages":[{"role":"user","content":"reply READY"}],"max_tokens":10}'

Expected response includes: "content":"READY"

FAQ

Can I keep multiple providers in OpenCode config?

Yes. Add another key under `provider` (e.g. `anthropic` for direct Anthropic). OpenCode lets you pick at runtime with /model. Useful when you want clawfeeder for credits-based usage and direct accounts for high-stakes work.

Why does /model not list clawfeeder?

Config didn't load. Check JSON syntax (trailing commas, mismatched braces) with `jq < config.json`. OpenCode logs to stderr — run with --verbose to see parse errors.

Does OpenCode preserve conversation history between sessions?

Yes, in its local sessions directory. Each turn re-sends the full history to clawfeeder, so long sessions grow prompt_tokens linearly — keep an eye on credit spend.

Don't have an API key yet?

Sign up for 300 free credits, 7-day trial, all models

Get started free →
OpenCode × clawfeeder.ai — Integration Guide