Skip to main content
FireConnect routes OpenCode through Fireworks AI models. Install the CLI once, then use fireconnect on --harness opencode to switch providers without editing config files by hand.

Prerequisites

Install the CLI

If you do not already have fireconnect on your PATH, install it with:
curl -fsSL https://raw.githubusercontent.com/fw-ai/fireconnect/main/install.sh | bash
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.
For non-interactive setup:
curl -fsSL https://raw.githubusercontent.com/fw-ai/fireconnect/main/install.sh | FIREWORKS_API_KEY="fw_..." bash
The installer uses Node.js to update settings (it does not install or update npm packages), clones the CLI to ~/.fireconnect/cli, and adds a fireconnect launcher to ~/.local/bin.

Enable Fireworks routing

export FIREWORKS_API_KEY=fw_...
fireconnect on --harness opencode
Restart OpenCode after enabling, then confirm routing:
fireconnect status --harness opencode

Using Fire Pass

Use your fpk_... key instead of a standard fw_... key:
export FIREWORKS_API_KEY=fpk_...
fireconnect on --harness opencode --api-key fpk_...
FireConnect detects Fire Pass keys and defaults OpenCode to 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 is kimi-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 a provider.fireworks block into ~/.config/opencode/opencode.json:
  • An OpenAI-compatible adapter pointed at https://api.fireworks.ai/inference/v1
  • A default model set to fireworks/<model-id>
  • Your other providers are left untouched
FireConnect snapshots your original 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-key writes the literal key instead.
  • OpenCode’s auth.json is never touched.

CLI reference

All commands use --harness opencode:
fireconnect on --harness opencode        # Enable Fireworks routing
fireconnect off --harness opencode       # Restore original config
fireconnect status --harness opencode    # Check current provider
fireconnect list --harness opencode      # Show the current model
fireconnect set --harness opencode --main glm-5p1  # Switch model
fireconnect reset --harness opencode     # Reset model to default
Run fireconnect help <command> for all options.

Switch models

fireconnect set --harness opencode --main glm-5p1

Turn off Fireworks routing

fireconnect off --harness opencode
This restores your previous opencode.json from the backup in ~/.fireconnect/opencode/.

Use a non-default config file

fireconnect on --harness opencode --config-path /path/to/opencode.json

Built-in provider connection

OpenCode also supports connecting to Fireworks directly without FireConnect:
  1. Type /connect in OpenCode and search for fireworks.ai
  2. Paste your Fireworks API key and press Enter
  3. Type /models and select a model (for Fire Pass, choose Kimi K2.6 Turbo)

Source

FireConnect is open source: github.com/fw-ai/fireconnect