Migrate
Migrate from Fireworks AI
Drop-in for Fireworks' OpenAI-compatible API. Bigger catalog (frontier closed models + every modality), same edge latency, lower platform fee on top-ups.
CLI automation for Fireworks AI isn't shipped yet — you'll do this manually below. PRs welcome at packages/aig-cli/src/commands/migrate.ts.
TL;DR — three lines
# 1. set your AIgateway key export AIGATEWAY_API_KEY="sk-aig-..." # 2. change the base URL base_url="https://api.aigateway.sh/v1" # was https://api.fireworks.ai/inference/v1 # 3. search-and-replace the env var name
What changes, line-by-line
The table below is what aig migrate fireworks rewrites. If you're doing it by hand, do these in order.
| Thing | Fireworks AI | AIgateway |
|---|---|---|
| Base URL | https://api.fireworks.ai/inference/v1 | https://api.aigateway.sh/v1 |
| API key env var | FIREWORKS_API_KEY | AIGATEWAY_API_KEY |
| Model slug | accounts/fireworks/models/llama-v4-scout-instruct | meta/llama-4-scout (see /models) |
| Catalog | Open-weight + a few hosted closed models | 900+ across every modality |
| Per-deployment configs | Custom serverless deployments | BYO routing rules in dashboard |
Before / after — Python (OpenAI SDK)
BEFORE · Fireworks AI
from openai import OpenAI
client = OpenAI(
base_url="https://api.fireworks.ai/inference/v1",
api_key=os.environ["FIREWORKS_API_KEY"],
)
r = client.chat.completions.create(
model="anthropic/claude-opus-4.7",
messages=[{"role": "user", "content": "Hi"}],
)AFTER · AIgateway
from openai import OpenAI
client = OpenAI(
base_url="https://api.aigateway.sh/v1",
api_key=os.environ["AIGATEWAY_API_KEY"],
)
r = client.chat.completions.create(
model="anthropic/claude-opus-4.7",
messages=[{"role": "user", "content": "Hi"}],
)Behavioral notes
- Model slugs differ — Fireworks uses accounts/<org>/models/<name>; AIgateway uses provider/model. Map via /models.
- Frontier models (GPT-5.4, Claude Opus 4.7, Gemini 3.1 Pro) are available in AIgateway but not Fireworks.
- Custom serverless model deployments: not supported in AIgateway today; reach out via /enterprise if you need this.
Credit match
Email your last invoice from Fireworks AI to switch@aigateway.sh and we match the credit up to $1,000 (24-hour turnaround). Or read the full pitch at /switch/fireworks.
What to read next
- BYOK — bring your existing Fireworks AI provider keys; pay 0% on those routes.
- Sub-accounts — per-customer keys with spend caps; the closest analogue to workspace-isolated keys.
- All migration guides — same docs for OpenRouter, Portkey, Helicone, LiteLLM, Together, Replicate, Fireworks, Requesty.