llm

metered LLM proxy gateway — bring a gateway key, not a provider key

One endpoint in front of Anthropic, OpenAI and DeepSeek, like a self-hosted OpenRouter. Every request is metered in USD (priced live via the pricing browser / llm-live-pricing) against the calling key's budget; upstream provider keys never leave the gateway. The API lives at https://api.lishuyu.app/llm.

Your key

Your key is kept in this browser's localStorage only and is sent solely to api.lishuyu.app/llm — this static host never sees it.

Key management (platform admin)

Docs

Quick start
# OpenAI SDK — works for all three providers
from openai import OpenAI
client = OpenAI(base_url="https://api.lishuyu.app/llm/v1", api_key="llmgw_...")
client.chat.completions.create(
    model="anthropic/claude-sonnet-5",   # or gpt-5, deepseek-chat, ...
    messages=[{"role": "user", "content": "hi"}],
)

# Anthropic SDK — native /v1/messages, cache_control passes through
from anthropic import Anthropic
client = Anthropic(base_url="https://api.lishuyu.app/llm", api_key="llmgw_...")

Bare well-known ids (claude-*, gpt-*, deepseek-*) route without a prefix; anything else needs the provider/ prefix. Streaming is passed through chunk-for-chunk.

Keys & budgets

Keys (llmgw_...) are issued by the platform admin (panel above). Each key carries:

knobmeaning
limit_usdUSD budget; requests are rejected with 402 once the window's spend reaches it (the last request may overshoot slightly — usage is only known post-response)
periodwhen the budget resets: total (never), daily / monthly (UTC calendar), or rolling (sliding window)
modelsallowlist of glob patterns, e.g. ["deepseek-*", "anthropic/claude-haiku-*"]
service_tieroptional — forced onto every upstream request
zdrzero data retention: token counts and cost are recorded, request/response bodies are not (default keeps bodies for audit)

Check your own balance any time — the "Your key" panel above, or: curl -H "Authorization: Bearer llmgw_..." https://api.lishuyu.app/llm/api/me

Batch jobs

Anthropic Message Batches (POST /v1/messages/batches) and the OpenAI Batch API (POST /v1/files + POST /v1/batches) are proxied too. A batch debits your key once, when its results are fetched, at the providers' 50% batch rate.

Model pricing

Live prices from llm-live-pricing — LiteLLM's community table refreshed hourly, normalized per 1M tokens. USD is canonical; other currencies use daily keyless FX rates.

modelprovider input / 1M (USD) output / 1M cache read context
LLM / agent navigation — how to call llm

LLM proxy gateway with per-key credit control: one endpoint fronting Anthropic/OpenAI/DeepSeek, metered in USD. Keys are admin-issued (llmgw_...) with model allowlists, quota windows, and optional ZDR.

Base URL: https://api.lishuyu.app/llm — paths below are relative to it. This host (llm.lishuyu.app) is a static frontend for humans: key self-service and admin key management on /, a pricing browser on /pricing (backed by https://api.lishuyu.app/llm-live-pricing — see its own agent nav). Agents should call the APIs directly, not this page.

methodpathauthpurpose
POST/v1/chat/completionsgateway keyOpenAI-compatible chat proxy (streaming ok); model routes by prefix or well-known name
POST/v1/messagesgateway keyAnthropic-native messages proxy (cache_control passes through)
GET/v1/modelsgateway keythe key's model allowlist
POST/v1/messages/batchesgateway keyAnthropic batch create; results debit once at 50%
POST/v1/batchesgateway keyOpenAI batch create (upload input via POST /v1/files, purpose=batch)
GET/api/megateway keybalance, spend and config for the calling key
POST/api/keysadminissue a key: limit_usd, period, models globs, service_tier, zdr
GET/api/keysadminlist keys with window spend
PATCH/api/keys/{id}adminedit limits/allowlist/tier/zdr, disable
DELETE/api/keys/{id}adminrevoke (ledger rows are kept)
GET/api/usageadmindebit ledger; ?key_id= filter

Auth: Authorization: Bearer llmgw_<...> (or x-api-key for the Anthropic SDK). Admin endpoints take a platform PAT/JWT instead.

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.