Faster anyrouter/free
Gateway time on anyrouter/free dropped at the slow end, from about 5 seconds to 1.6 seconds. If the first upstream stays silent, anyrouter/free and anyrouter/auto start a second one and keep whichever sends a token first.
anyrouter/free and anyrouter/auto are faster for two reasons. The gateway itself adds less time, and a silent upstream no longer holds the first token.
On 2026-10-03 we timed 40 streaming calls to anyrouter/free with Server-Timing. The slowest gateway time fell from about 5.0 seconds to 1,631 ms at p95, and 357 ms at p50. Time to first token, which still includes the upstream, moved only at the tail. Forty calls is a direction, not a guarantee.
| Time to first token | Before | After |
|---|---|---|
| p50 | 1,333 ms | 1,355 ms |
| p95 | 6,864 ms | 5,491 ms |
If the first upstream sends no token for about 2.5 seconds, AnyRouter starts one other provider or model. The first real token wins, the other call is cancelled, and you pay only for the winner. That is streaming only, at most one extra call, and it is skipped for very long prompts. Healthy providers answer before the delay, so it did not fire in that sample. It is on by default.
No code change. Vercel AI SDK: createAnyRouter() reads ANYROUTER_API_KEY.
import { createAnyRouter } from "@anyr/ai-sdk-provider"
import { streamText } from "ai"
const anyrouter = createAnyRouter()
const result = streamText({
model: anyrouter("anyrouter/free"),
prompt: "Summarize this diff in three bullets.",
})
for await (const chunk of result.textStream) process.stdout.write(chunk)Same model from a coding agent (playbook): anyr login, then anyr claude --model "anyrouter/free" or anyr opencode --model "anyrouter/auto".
When a second upstream ran, the response includes x-anyrouter-hedge, for example won=<model>;delay=2500. Turn it off under Routing in Dashboard → Settings, or send {"parallelHedgeEnabled": false} to PUT /api/v1/user/preferences. Requests then try one upstream at a time.
If a :free model fails on every route, including donated keys, AnyRouter answers with anyrouter/free instead of an error. The response sets x-anyrouter-fallback: anyrouter/free, and model names the model that answered.
More: routing · free tier · AI SDK · coding agents.
No terminal? Stream a first message from anyrouter/free in the playground.
Try in playground