How to Use Claude Fable 5 in OpenCode
The Claude 5 generation is here — Claude Fable 5, Claude Sonnet 5 — alongside OpenAI's GPT-5.6. OpenCode can run all of them today: it supports 75+ providers and any OpenAI-compatible endpoint. This guide walks through the 5-minute setup, then covers when to use each model.
Step 1 — Get an API key
You need access to the models first. Two routes:
- Direct vendor APIs — an Anthropic key for Fable 5 / Sonnet 5, an OpenAI key for GPT-5.6 (two accounts, two bills).
- One aggregated platform — our recommended API platform already serves Claude Fable 5, Claude Sonnet 5, and GPT-5.6 behind a single OpenAI-compatible endpoint, at a discount. One registration covers all three.
Step 2 — Add the provider to OpenCode
Add an OpenAI-compatible provider to your opencode.json. The baseURL comes from your platform's dashboard after registration:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"my-api-platform": {
"npm": "@ai-sdk/openai-compatible",
"name": "My API Platform",
"options": {
"baseURL": "<your-platform-baseURL>"
},
"models": {
"claude-fable-5": {
"name": "Claude Fable 5"
},
"claude-sonnet-5": {
"name": "Claude Sonnet 5"
},
"gpt-5.6": {
"name": "GPT-5.6"
}
}
}
}
}Model IDs must match what your platform's GET /v1/models endpoint returns — check its model list if a name differs. Full options are covered in the provider configuration guide.
Step 3 — Pick your model and go
Start opencode, run the /models command, and select the model for the task at hand. You can switch models mid-project at any time.
/modelsUsing Claude Fable 5 in OpenCode
Fable 5 is Anthropic's newest flagship — the strongest Claude yet for coding and long-running agentic work. In OpenCode it shines on the hard stuff: multi-file refactors, debugging gnarly issues, and agent workflows that plan before they edit. Pair it with permissions for safe autonomous runs.
Using Claude Sonnet 5 in OpenCode
Sonnet 5 is the speed/quality sweet spot of the Claude 5 family — a strong default for everyday coding. A common setup: Sonnet 5 as your main model, escalating to Fable 5 only when a task stalls. Your wallet will notice the difference.
Using GPT-5.6 in OpenCode
GPT-5.6 is OpenAI's latest generation. Because OpenCode is provider-agnostic, you can keep it configured next to the Claude models and A/B the same prompt across families — useful when one model gets stuck on a problem the other cracks.
Why route through one platform?
Managing separate Anthropic and OpenAI accounts means two API keys, two billing dashboards, and two rate-limit policies. An aggregated platform gives you all the models above through one key and one endpoint — and the platform we recommend does it at up to 90% below official prices, with instant registration.
FAQ
Q: Can OpenCode use Claude Fable 5?
A: Yes. OpenCode supports any OpenAI-compatible provider, so you can run Claude Fable 5 through an API platform that serves it, or connect the Anthropic API directly via the providers guide.
Q: What is the model ID for Claude Fable 5?
A: Anthropic's model ID is claude-fable-5. On API platforms, the ID must match what their /v1/models endpoint returns — check your platform's model list.
Q: Can I switch between Fable 5, Sonnet 5, and GPT-5.6 in one session?
A: Yes. Once configured under one provider, run /models in OpenCode to switch per task — flagship for hard problems, cheaper models for routine edits.
Related reading: OpenCode vs Claude Code · Best AI Coding Agents in 2026 · OpenCode Zen models