How to migrate
1
Create an API key
Create a key in the Fireworks dashboard and export it:
2
Point your client at Fireworks
Pick your API in the tabs below. In your existing code, update the highlighted lines: the base URL, API key, and model name. The rest of your code stays the same.
3
Pick a replacement model
Fireworks model names use the format
accounts/fireworks/models/<model>. To find the closest match for the model you use today, see Compare models or browse the model catalog.4
Check what behaves differently
Most requests work unchanged. These are the differences that most often affect a migration:
- OpenAI: when the prompt plus
max_tokensexceeds the context window, Fireworks lowersmax_tokensinstead of returning an error. Setcontext_length_exceeded_behaviortoerrorto match OpenAI. Streaming responses includeusagein the final chunk. - Anthropic: Fireworks does not run server-side tools such as web search, code execution, memory, or web fetch. Declare them as client-side tools and run them yourself. The
anthropic-versionheader is ignored. - NIM and vLLM: Fireworks maps the thinking keys in
chat_template_kwargstoreasoning_effortand drops any other keys in that object.
5
Test before you switch traffic
Send one request first. Then run the prompts, tool calls, and streaming paths your app depends on, and compare output quality and latency before you move production traffic.
Next steps
Get an API key
Create and manage keys in the Fireworks dashboard.
Compare models
Open-weight alternatives to Claude, GPT, and Gemini by use case.