Microsoft Foundry portal setup
Enable Fireworks on Foundry, create a deployment, and find your project endpoint — start here if you have not set up a Foundry resource yet
CLI terminology: The Foundry provider is
--provider azure (or on --azure). Harness configs display the label Fireworks on Microsoft Foundry. Model IDs are your deployment names (for example, FW-GLM-5.1) — not Fireworks serverless short IDs like glm-fast-latest.Supported harnesses
| Harness | Azure in FireConnect | Notes |
|---|---|---|
| OpenCode | Yes | fireworks-azure provider in opencode.json |
| Codex | Yes | fireworks-azure block in config.toml |
| Pi | Yes | fireworks-azure provider in models.json |
| Claude Code | Not yet | claude on always wires direct Fireworks today |
| Cursor | Not yet | cursor on always wires direct Fireworks; global --provider azure is ignored |
| VS Code | Not yet | vscode on always wires direct Fireworks today |
| Deep Agents | Not yet | deepagents on always wires direct Fireworks today |
fireconnect configure --provider azure and then fireconnect cursor on (or claude on, etc.), the harness enables direct Fireworks and does not read the global Azure settings.
Prerequisites
- A Microsoft Foundry resource with at least one Fireworks model deployment (for example,
FW-GLM-5.1orFW-MiniMax-M2.5) - Your Foundry resource endpoint and Azure API key from the Microsoft Foundry portal
- OpenCode, Codex, or Pi installed locally
- FireConnect installed (see Overview — Install)
Configure once, then enable harnesses
fireconnect configure sets the Foundry provider and endpoint. It does not set your Fireworks API key — use fireconnect login for that when routing through the Fireworks gateway.
provider and azure block in ~/.fireconnect/config.json. After configuring, enable harnesses normally:
--main, FireConnect defaults to FW-GLM-5.1.
Endpoint normalization
Pass your Foundry endpoint to--base-url. FireConnect normalizes whatever you paste to the correct OpenAI-compatible base at https://<resource>.services.ai.azure.com/openai/v1:
- Bare resource root (
https://<resource>.services.ai.azure.com) - Portal project endpoint (
.../api/projects/<name>) - Foundry Models route (
.../models) - An already-correct base (
.../openai/v1)
API key storage
- Pass
--api-keyto write the Azure key into~/.fireconnect/config.json - Or export
AZURE_API_KEYbeforeconfigure— FireConnect stores an environment reference instead
One-off Foundry routing
Route a single harness through Foundry without changing global config:--azure alone reuses it:
What each harness writes
Each harness writes a dedicatedfireworks-azure provider distinct from the Fireworks gateway. off restores your original config byte-for-byte.
| Harness | Config file | Provider ID | Notes |
|---|---|---|---|
| OpenCode | ~/.config/opencode/opencode.json | fireworks-azure/<deployment> | @ai-sdk/openai-compatible adapter; options.baseURL + options.apiKey |
| Codex | ~/.codex/config.toml | fireworks-azure | wire_api = "chat"; bearer or env_key = "AZURE_API_KEY" |
| Pi | ~/.pi/agent/models.json + settings.json | fireworks-azure | openai-completions provider; key as literal or $AZURE_API_KEY in auth.json |
fireconnect <harness> status reports azure as the provider along with the endpoint and deployment name.
Turn off Foundry routing
There are two ways to stop using Microsoft Foundry, depending on what you want next.Switch back to direct Fireworks
Use this when you want to keep FireConnect enabled but route through the Fireworks gateway again instead of your Foundry deployment.on replaces the fireworks-azure provider with the normal Fireworks gateway config. You do not need to run off first.
The Azure endpoint and key remain stored in ~/.fireconnect/config.json but are unused while provider is fireworks. They are used again if you run configure --provider azure later.
Remove FireConnect from a harness entirely
Useoff to restore the config snapshot from before FireConnect was first enabled for that harness — your original provider settings, byte-for-byte:
off removes the fireworks-azure provider from harness config files. It does not change the global provider field in ~/.fireconnect/config.json. If provider is still azure, the next on will route through Foundry again unless you run configure --provider fireworks first.
Restart the harness after off if it is already running.
Remove FireConnect everywhere
| Goal | Commands |
|---|---|
| Stop Foundry, keep FireConnect on Fireworks | fireconnect configure --provider fireworks then fireconnect <harness> on |
| Undo FireConnect for one harness | fireconnect <harness> off |
| Undo FireConnect on all harnesses | fireconnect uninstall |