Freerouter

Core Concepts

Aliases, resolution pipeline, provider priority, and key format reference for completely free ($0 cost) model routing.

Aliases

Aliases map capability requirements to provider models. Pass any free:${string} alias to languageModel().

AliasFilterUse case
free:autononeCatch-all, anything that works
free:fastfastChat, low-latency Q&A
free:reasoningreasoningMath, logic, complex analysis
free:long-contextlong-contextDocument analysis, large context
free:visionvisionImage inputs
free:tool-usetool-useFunction/tool calling
freerouter.languageModel("free:auto", keys)
freerouter.languageModel("free:fast", keys)
freerouter.languageModel("free:reasoning", keys)

Unknown aliases

Any free:${string} that doesn't match a known capability resolves as free:auto (all models).


Resolution pipeline

alias → filter by capability
  → exclude deprecated models
  → exclude providers without key
  → exclude down providers (unless cooldown expired)
  → sort by priority
  → try each until one succeeds

Step by step

  1. Capability filter - maps alias to capability tag, queries registry
  2. Deprecation filter - removes models marked deprecated: true
  3. Key filter - removes providers where caller has no key
  4. Health filter - removes providers in "down" state (unless 10s cooldown expired)
  5. Priority sort - orders remaining candidates by provider priority
  6. Failover loop - tries each candidate until one succeeds or all fail

Provider priority

Providers are tried in this order (all else equal):

PriorityProviderModels
1Groq4
2Google Gemini5
3NVIDIA NIM7
4OpenRouter (free)9
5Together AI4
6Fireworks AI4
7Mistral AI4
8Cloudflare Workers AI19
9Cerebras4
10SambaNova4
11DeepSeek2
12DeepInfra8
13Cohere5

Rate-limited providers are deprioritized but still included. Down providers are excluded entirely.


Key Format Reference

ProviderKey formatGet one
Groqgsk_...console.groq.com
Google GeminiAIza...aistudio.google.com
NVIDIA NIMnvapi-...build.nvidia.com
OpenRoutersk-or-...openrouter.ai
Cloudflareaccount_id:api_tokendash.cloudflare.com
Together AIStandard keytogether.ai
Fireworks AIStandard keyfireworks.ai
Mistral AIapi_...console.mistral.ai
CerebrasStandard keycloud.cerebras.ai
SambaNovaStandard keysambanova.ai
DeepSeekStandard keyplatform.deepseek.com
DeepInfraStandard keydeepinfra.com
CohereStandard keydashboard.cohere.com

Security

Keys are SHA-256 fingerprinted on receipt. Raw keys never appear in logs, error messages, or health state.

On this page