---
title: "OpenCode + rawroute: 50–70% Lower Frontier API"
canonical: "https://rawroute.dev/integrations/opencode"
lang: "en"
last_verified: "2026-11-28"
description: "Configure OpenCode with rawroute (https://api.rawroute.dev/v1) for private Claude 5.5, GPT-6.2, Gemini 4, and Grok 4.7 calls at 50–70% below list with 0% fee."
---

# Use rawroute with OpenCode.

Free contributor endpoints often log prompts for model training and throttle under load. Adding rawroute as a custom provider in opencode.json gives you private, unmodified Claude Opus 5.5 ($2.00 / $10.00), Sonnet 5.5 ($1.00 / $5.00), and GPT-6.2 Astra ($2.40 / $12.00) with 0% top-up fee and automatic multi-provider failover.

## Setup Steps

1. Create or edit ~/.config/opencode/opencode.json (or project opencode.json).
2. Add rawroute as an OpenAI-compatible provider pointing to https://api.rawroute.dev/v1 with RAWROUTE_API_KEY.
3. Select rawroute/claude-sonnet-5-5 or rawroute/gpt-6.2-sol inside OpenCode.

### opencode.json

```json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "rawroute": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "rawroute",
      "options": {
        "baseURL": "https://api.rawroute.dev/v1",
        "apiKey": "{env:RAWROUTE_API_KEY}"
      },
      "models": {
        "claude-sonnet-5-5": { "name": "Claude Sonnet 5.5" },
        "claude-opus-5-5": { "name": "Claude Opus 5.5" },
        "gpt-6.2-sol": { "name": "GPT-6.2 Sol" },
        "gemini-4-argon": { "name": "Gemini 4 Argon" }
      }
    }
  }
}
```

## When NOT to use rawroute

- Use direct vendor subscriptions if you prefer fixed monthly seat quotas over pay-as-you-go token billing.
