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. To connect a coding harness (Claude Code, OpenCode, and others) to FireRouter, use FireConnect instead.

Prerequisites

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

Chat Completions

Send a request to the Chat Completions endpoint with the FireRouter model ID:
Simple prompts are usually redirected to GLM 5.2 on Fireworks. Harder prompts pass through to Claude Opus 4.8 using your Anthropic key.

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. Expect pass-through to Claude Opus 4.8.
  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.