<!-- retoor <retoor@molodetz.nl> -->
# Models, gateways, and cost

## Default

`x-ai/grok-4.3` on OpenRouter (`OPENROUTER_API_KEY`) at
`https://openrouter.ai/api/v1/chat/completions`. This default is
fixed; do not substitute another model without an explicit reason
recorded in the run notes.

## Order and cooldowns

Try the gateway first, then OpenRouter. Each endpoint carries its
own 60 second cooldown after a failure; a success clears it. Never
call an endpoint inside its cooldown window; skip to the next one.

## Fallback tiers

When the default is unavailable, fall through cheaper tiers in this
order: `google/gemma-3-12b-it`, `google/gemma-3-12b-it:free`,
`google/gemma-4-26b-a4b-it:free`, `google/gemma-4-26b-a4b-it`,
`qwen/qwen3-30b-a3b`, `meta-llama/llama-4-scout`,
`meta-llama/llama-4-maverick`. Free tiers first within equal
capability; record which model produced what.

## Cost accounting

Every gateway response contributes prompt tokens, completion tokens,
and cost to running per-model totals. Unit prices per million
tokens: gemma-3-12b 0.04 prompt and 0.13 completion, gemma-4-26b
0.08 and 0.35, qwen3-30b 0.08 and 0.28, llama-4-scout 0.08 and 0.30,
llama-4-maverick 0.15 and 0.60. Sum into the job totals the host
reads for budget enforcement. Never exceed the per-job spend cap;
stop generating and write up partial findings instead.
