fireconnect on --harness opencode to switch providers without editing config files by hand.
Prerequisites
- OpenCode installed
- A Fireworks API key (
fw_...) or a Fire Pass key (fpk_...) - The FireConnect CLI (see Install the CLI below)
Install the CLI
If you do not already havefireconnect on your PATH, install it with:
The installer also configures Claude Code by default. If you only use OpenCode, run
fireconnect off after install to restore your Claude Code settings, then follow the steps below.~/.fireconnect/cli, and adds a fireconnect launcher to ~/.local/bin.
Enable Fireworks routing
Using Fire Pass
Use yourfpk_... key instead of a standard fw_... key:
kimi-k2p6-turbo — the only model covered by the Fire Pass subscription.
Default model
OpenCode routes a single default model (no opus/sonnet/haiku alias slots). The default iskimi-k2p6-turbo, written to config as fireworks/accounts/fireworks/routers/kimi-k2p6-turbo.
Short model IDs like glm-5p1 are expanded to full Fireworks paths (for example, accounts/fireworks/models/glm-5p1).
What gets written
FireConnect merges aprovider.fireworks block into ~/.config/opencode/opencode.json:
- An OpenAI-compatible adapter pointed at
https://api.fireworks.ai/inference/v1 - A default
modelset tofireworks/<model-id> - Your other providers are left untouched
opencode.json before the first change. The snapshot lives in ~/.fireconnect/opencode/. Running fireconnect off --harness opencode restores the file byte-for-byte.
API key handling
- If the key comes from
FIREWORKS_API_KEY, it is written as{env:FIREWORKS_API_KEY}so the secret stays out of the config file. - Passing
--api-keywrites the literal key instead. - OpenCode’s
auth.jsonis never touched.
CLI reference
All commands use--harness opencode:
fireconnect help <command> for all options.
Switch models
Turn off Fireworks routing
opencode.json from the backup in ~/.fireconnect/opencode/.
Use a non-default config file
Built-in provider connection
OpenCode also supports connecting to Fireworks directly without FireConnect:- Type
/connectin OpenCode and search for fireworks.ai - Paste your Fireworks API key and press Enter
- Type
/modelsand select a model (for Fire Pass, choose Kimi K2.6 Turbo)