Bug
OpenRouter free-tier models report GPT-4o default pricing (~$2.50/$10.00 per 1M tokens) instead of $0 in IronClaw UI.
Reproduction
Set .env:
LLM_BACKEND=openai_compatible
LLM_BASE_URL=https://openrouter.ai/api/v1
LLM_API_KEY=sk-or-...
LLM_MODEL=openrouter/free
Send any message. Logs show:
DEBUG LLM call used 7749 input + 180 output tokens ($0.021172)
Root cause
src/llm/costs.rs model_cost() strips the provider prefix via rsplit_once('/'), leaving free. This doesn't match any known model or the is_local_model() heuristic, so it falls back to default_cost() (GPT-4o pricing).
Same issue for any OpenRouter model with the :free suffix (e.g. stepfun/step-3.5-flash:free).
Expected behavior
All models with the :free suffix and the openrouter/free router should report zero cost.
Bug
OpenRouter free-tier models report GPT-4o default pricing (~$2.50/$10.00 per 1M tokens) instead of $0 in IronClaw UI.
Reproduction
Set
.env:Send any message. Logs show:
Root cause
src/llm/costs.rsmodel_cost()strips the provider prefix viarsplit_once('/'), leavingfree. This doesn't match any known model or theis_local_model()heuristic, so it falls back todefault_cost()(GPT-4o pricing).Same issue for any OpenRouter model with the
:freesuffix (e.g.stepfun/step-3.5-flash:free).Expected behavior
All models with the
:freesuffix and theopenrouter/freerouter should report zero cost.