llm-live-pricing

live LLM prices, USD per 1M tokens

Live LLM prices, one JSON API — refreshed hourly from LiteLLM's community price table, normalized to USD per 1M tokens.

$ curl 'https://api.lishuyu.app/llm-live-pricing/api/models?provider=anthropic&q=opus'
$ curl 'https://api.lishuyu.app/llm-live-pricing/api/models/claude-opus-5?currency=CNY'
$ curl 'https://api.lishuyu.app/llm-live-pricing/api/cost?model=claude-opus-5&input_tokens=12000&output_tokens=3000'

Filters: provider (e.g. anthropic, openai, gemini), q (substring), mode (chat, embedding, ...), limit/offset. currency=CNY (or any code from /api/currencies) adds a converted block — daily keyless FX rates, USD stays canonical. DeepSeek's v4 models carry pricing_windows (peak = Mon-Fri 01:00-04:00 & 06:00-10:00 UTC, off-peak = 50%); /api/cost picks the window for at (default: now) and applies long-context tiers (e.g. Gemini above-200k) from the prompt size. /api/meta reports snapshot freshness; when an upstream is unreachable the last good snapshot is served with stale: true.

LLM / agent navigation — how to call llm-live-pricing

Live LLM pricing across providers (Anthropic, OpenAI, Google, ...), normalized to USD per 1M tokens with optional currency conversion. Cached from LiteLLM's public price table; DeepSeek peak/off-peak windows are modeled.

Base URL: https://api.lishuyu.app/llm-live-pricing — paths below are relative to it.

methodpathauthpurpose
GET/api/modelsnonelist model pricing; filters: provider, q, mode, limit, offset, currency
GET/api/models/{model_id}noneone model (id may contain '/'); optional currency
GET/api/providersnoneproviders with model counts
GET/api/costnoneestimate request cost: model, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens; optional currency and at (ISO time — picks DeepSeek peak/off-peak window)
GET/api/currenciesnonesupported currency codes
GET/api/metanoneupstream snapshot freshness (pricing + fx)

Other platform services: GET https://registry.lishuyu.app/llm.txt (public how-to), or authenticate and query GET https://registry.lishuyu.app/api/services/discover/{capability} to find a capability, then call that service directly.