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

Prerequisites

Enable Fireworks routing

Restart OpenCode after enabling, then confirm routing:

Using Fire Pass

Use your fpk_... key during login or with --api-key:
FireConnect detects Fire Pass keys and defaults OpenCode to glm-fast-latest.

Default model

OpenCode routes a single default model (no opus/sonnet/haiku alias slots). The default is glm-fast-latest, written to config as fireworks-ai/glm-fast-latest. 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 fireworks-ai provider block into ~/.config/opencode/opencode.json:
  • An OpenAI-compatible adapter pointed at https://api.fireworks.ai/inference/v1
  • A default model set to fireworks-ai/<model-id> (for example, fireworks-ai/glm-fast-latest)
  • options.apiKey as a baked plaintext literal (file mode 0600)
  • The preferred serverless catalog registered in the provider’s models for OpenCode’s /model picker
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. OpenCode’s auth.json is never touched.

Browsing and picking models

fireconnect model list resolves the API key from the OS keychain or global config. Fire Pass keys (fpk_...) show Fire Pass-supported routers only and cannot select firerouter. Standard keys include firerouter.

FireRouter

Pass --anthropic-api-key sk-ant-... when your workspace does not have Anthropic BYOK provisioned server-side.

CLI reference

Run fireconnect opencode help for all options.

Switch models

Turn off Fireworks routing

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

Use a non-default config file

Fireworks on Microsoft Foundry

OpenCode supports Fireworks on Microsoft Foundry (CLI: --provider azure or on --azure). See the FireConnect overview and Microsoft Foundry integration guide for portal setup.

Configure and enable

One-off routing without changing global config:
Pass your Foundry model with --model (for example, FW-GLM-5.2), not a Fireworks serverless short ID like glm-latest.

What gets written

FireConnect adds a fireworks-azure provider labeled Fireworks on Microsoft Foundry to opencode.json, pointed at your Foundry OpenAI-compatible endpoint (.../openai/v1). The default model reference becomes fireworks-azure/FW-GLM-5.2. Use fireconnect model list only for browsing Fireworks serverless models on the direct gateway path. With Foundry, switch models with on --model FW-GLM-5.2.

Turn off Foundry routing

To switch back to the Fireworks gateway, change the global provider and re-enable:
To remove FireConnect entirely and restore your original opencode.json:
See Turn off Foundry routing for details on global config behavior and uninstall.

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 model such as GLM Fast Latest)

Source

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