Skip to main content
Routing preference controls how strongly a firerouter request favors its primary model or lower-cost models. Set it per HTTP request with x-routing-preference, or configure it for a supported harness with FireConnect.

Preference levels

Send an integer from 1 (strongest preference for the primary model) to 5 (strongest preference for lower-cost models):

HTTP header

The HTTP header accepts only the integers 1 to 5. Names such as balanced are FireConnect CLI values, not HTTP header values. Set the header on an API request:
If the header is missing, invalid, or out of range, the router uses balanced behavior. It does not add a literal x-routing-preference: 3 header.

FireConnect

When you connect a harness to firerouter or a supported firerouter/... ID, pass --routing-preference with the connect command:
Every harness can use any FireRouter ID. The table shows which IDs accept FireConnect’s --routing-preference flag: FireConnect accepts values 1 to 5 or the corresponding level names. In Claude Code, fireconnect claude --model firerouter/opus works, but adding --routing-preference to that ID returns an error: --routing-preference requires --model firerouter. To set a preference where FireConnect does not support it, send the x-routing-preference header with manual setup, for example in ANTHROPIC_CUSTOM_HEADERS for Claude Code or http_headers for Codex. Cursor IDE and the Copilot App cannot send extra headers. Cursor CLI is not supported.

When to adjust

  • High-volume workloads with many simple requests: try 4 or 5 so summaries, formatting, and straightforward Q&A are more likely to use a lower-cost model.
  • Tasks where quality is critical (security review, complex reasoning, nuanced writing): try 1 or 2 so the router favors its primary model.
  • Evaluating routing: start at 3 (balanced), then move one step at a time and compare cost and output quality.
  • FireRouter: firerouter, firerouter/opus, firerouter/astra, and firerouter/sol
  • APIs and SDKs: HTTP headers and Provider Keys
  • FireConnect: enable a router in a coding harness