Skip to main content
FireConnect routes OpenCode through Fireworks AI models. See the FireConnect overview for install and CLI basics.

Prerequisites

The installer registers Claude Code and OpenCode by default. If you only use OpenCode, you can skip fireconnect claude on and go straight to the steps below.

Enable Fireworks routing

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

Using Fire Pass

Use your fpk_... key instead of a standard fw_... key:
export FIREWORKS_API_KEY=fpk_...
fireconnect opencode on --api-key fpk_...
FireConnect detects Fire Pass keys and defaults OpenCode to glm-latest.

Default model

OpenCode routes a single default model (no opus/sonnet/haiku alias slots). The default is glm-latest, written to config as fireworks/accounts/fireworks/routers/glm-latest[1m]. 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 opencode off 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.

Browsing and picking models

fireconnect opencode model list              # browse serverless endpoints
fireconnect opencode model select            # pick OpenCode's default model
fireconnect opencode model select --search glm
fireconnect opencode model list resolves the API key from OpenCode’s stored config. Fire Pass keys (fpk_...) show Fire Pass-supported routers only.

CLI reference

fireconnect opencode on              # Enable Fireworks routing
fireconnect opencode off             # Restore original config
fireconnect opencode status          # Check current provider and model
fireconnect opencode model list      # Browse serverless endpoints
fireconnect opencode model select    # Pick a model interactively
fireconnect opencode model reset     # Reset model to default
fireconnect opencode help            # Show harness-specific help
Run fireconnect opencode help for all options.

Switch models

fireconnect opencode on --main glm-5p1

Turn off Fireworks routing

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

Use a non-default config file

fireconnect opencode on --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 a supported router such as GLM Latest)

Source

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