FW-GLM-5.2. You need:
- The Foundry resource endpoint, such as
https://YOUR_RESOURCE.services.ai.azure.com - An Azure API key from Foundry, not a Fireworks key (
fw_...) - The deployment name
Choose a path
Foundry serves Fireworks models through an OpenAI-compatible Chat Completions API. Claude Code sends Anthropic Messages requests, so it needs a gateway that translates between the two formats. Current Codex releases send only Responses API requests and reject
wire_api = "chat" in config.toml, which is what FireConnect writes for Codex on Foundry.
Connect with FireConnect
FireConnect writes the Foundry endpoint, key, and deployment into supported harnesses and restores the original settings withoff.
1
Set Foundry as the default provider
{env:AZURE_API_KEY} reference. To store the current value, add --api-key "$AZURE_API_KEY".2
Connect a harness with your deployment name
--model is your Azure deployment name, not a Fireworks serverless ID such as glm-latest. If you omit --model, FireConnect uses FW-GLM-5.2.3
Verify
azure and that the endpoint and deployment name are correct. Harness configs show the label Fireworks on Microsoft Foundry.--azure:
--azure alone reuses it: fireconnect cursor --azure --model FW-GLM-5.2.
fireconnect model list shows the Fireworks serverless catalog, not your Foundry deployments. Enter the deployment name with --model.
Accepted endpoint formats
Pass any of these Foundry URLs to--base-url. FireConnect converts it to 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) - A complete OpenAI-compatible base URL (
.../openai/v1)
Switch or disconnect
off does not change the default provider. If it is still azure, the next connection uses Foundry again. The saved Azure endpoint and key remain available if you switch back later.
Configure a harness manually
Any harness that supports a custom OpenAI-compatible provider can call Foundry directly. Use these values:
Check that the endpoint works before you configure the harness:
Use an LLM gateway
Put a gateway between the harness and Foundry when the harness needs a different API format, or when you want to keep the Azure key off developer machines. The gateway holds the Azure key and forwards requests to your deployment.Claude Code through a gateway
Claude Code sends Anthropic Messages requests, and Foundry serves Fireworks models over OpenAI Chat Completions. A gateway translates between the two, including streaming, tool calls, and reasoning blocks. Your Claude Code install stays unchanged. FireConnect does not configure this path.- Envoy AI Gateway
- LiteLLM
These steps follow the reference implementation in Claude Code on Foundry with Fireworks models, which includes the gateway config, a smoke test, demos, and cache measurement scripts. The gateway runs locally, with no Docker or Kubernetes.Replace Leave it running. In a second terminal, run The gateway also sends one shared prompt cache key for every request. Keep one key for your whole team, because Claude Code’s long system prompt is the same for every user.
Get your Foundry details
From Project settings in the Foundry portal, copy the endpoint and the Azure API key. You also need the deployment name, which often has a suffix such as
FW-GLM-5.2-standard. To list your deployments:Get the gateway and its config
darwin-arm64 with linux-amd64 or linux-arm64 for your machine.Configure
Copy
.env.example to .env and fill in three values:.env
FOUNDRY_MODEL is your deployment name, and it must match bodyMutation in aigw-foundry.yaml.Start and test the gateway
./smoke-test.sh to check plain, streaming, and tool-call responses before you involve Claude Code.The smoke test reports
11 passed, 0 failed.Point Claude Code at the gateway
Run The gateway adds the Azure key and the deployment name, so
./claude-foundry.sh, or set these values yourself:ANTHROPIC_AUTH_TOKEN is only a placeholder.Other harnesses
Configure the gateway with Foundry as an OpenAI-compatible upstream, using the base URL, Azure key, and deployment name from manual setup. Then point the harness at the gateway. For LiteLLM setup, see LLM Gateways. Keep the Azure key in the gateway config. Do not paste it into harness settings on developer machines.Related documentation
- Microsoft Foundry: enable Fireworks and create deployments
- Coding Harnesses: files FireConnect changes and restore behavior
- CLI Reference