Files
hermes-agent/agent
teknium1 e91a458d8a fix(pricing): price direct OpenAI/xAI/Anthropic/Google models missing from the snapshot
A direct first-party route whose model is absent from the bundled
official-docs snapshot fell through to the provider's own /models listing,
which carries no prices on api.openai.com or api.x.ai, and recorded the
turn as cost_status=unknown / $0 despite real billed usage (gpt-5-nano on
OpenAI, grok-4.3 on xAI in the live provider canary).

Widen the trusted models.dev fallback from Xiaomi to every pay-per-token
first-party API (openai, xai, anthropic, google, deepseek, xiaomi), keyed
by billing-route provider -> the vendor's API domain. The price applies
only on HTTPS:443 to that domain (or with no base URL, i.e. the provider
default), so relays, downgraded origins, custom endpoints and
subscription routes (xai-oauth, openai-codex) keep their own policy.
Drops the blanket try/except: get_model_info(allow_network=False) reads
only the memory/disk cache and does not raise.
2026-09-23 11:33:09 -07:00
..
…
…