# Model router The [credentials proxy](credentials-proxy.html) can route by model. Send requests to the virtual host `router` and each goes to the first rule, in the order you made them, whose `models` match the request body's `model`: ```sh harebox proxy rule add --secret-ref anthropic-api-key --host api.anthropic.com --header x-api-key --template '{secret}' --models '["claude-*"]' harebox proxy rule add --secret-ref openai-api-key --host api.openai.com --models '["gpt-*", "o*"]' # inside a sandbox: curl "$HAREBOX_PROXY_URL/router/v1/messages" -H "Authorization: Bearer $HAREBOX_PROXY_TOKEN" -H 'Content-Type: application/json' -d '{"model":"claude-sonnet-5-5", ...}' ``` A rule can name `fallback` rules. When its provider answers 429 or 5xx, or can't be reached, the same body goes to each fallback in turn. Use fallbacks for a second key or account with the same provider, or for providers with the same API. `harebox ai usage` then reports requests and tokens by model (`ai.by_model`). Tokens are counted when the provider's response reports them. The router costs nothing beyond the proxy: $1 for each day it's on, plus $1 per 1,000 requests. Bodies the router reads are limited to 8 MiB.