Skip to main content
This guide shows how to call FireRouter directly through the Fireworks inference API. See the overview for how routing works and the authentication page for header details. For coding harnesses, use FireConnect: fireconnect <harness> on --model firerouter (v0.9.0+). For manual Claude Code setup, see Claude Code (manual setup).

Prerequisites

  • A Fireworks API key (fw_...)
  • An Anthropic API key (sk-ant-...) for the default pass-through to Claude Opus 5

Chat Completions

Send a request to the Chat Completions endpoint with the FireRouter model ID:
With the default firerouter model ID, simple prompts are usually redirected to GLM 5.2 Fast on Fireworks. Harder prompts pass through to Claude Opus 5 using your Anthropic key. To use a different model combination, replace firerouter with one of the model-specific FireRouter slugs. If the selected slug includes an OpenAI model, send its key as -H "x-openai-api-key: $OPENAI_API_KEY". See Authentication.

Anthropic Messages

For clients that speak the Anthropic Messages API:

Verify routing

  1. Send a trivial prompt (for example “rename foo to bar”). Expect a fast response routed to the open model.
  2. Send a hard reasoning prompt. With the default firerouter model ID, expect pass-through to Claude Opus 5.
  3. Optionally set x-routing-preference to bias routing. See Routing preferences.
You can also send the Fireworks key as X-Fireworks-Api-Key instead of Authorization: Bearer. See Authentication for the full header reference.