Lovely RouterDocs
Get a key
Models API

Models & pricing

List the available models and their per-token prices with GET /v1/models, and see exactly how the charge for each call is computed.

Models are billed per token, at prices listed in US dollars per million tokens. Each call is charged from the token counts the model reports in its response, and the amount is deducted from your prepaid balance within seconds.

List models#

GET /v1/models returns every model you can call right now, with its context size, prices and the channel groups that serve it. It needs no API key, and it works with client.models.list() in both the OpenAI and Anthropic SDKs.

curl https://lovelyrouter.com/v1/models

A trimmed response:

Response
{
  "object": "list",
  "data": [
    {
      "id": "claude-sonnet-5.5",
      "object": "model",
      "type": "model",
      "display_name": "Claude Sonnet 5.5",
      "created": 1700000000,
      "created_at": "2025-01-01T00:00:00Z",
      "owned_by": "Anthropic",
      "context_length": 1000000,
      "pricing": {
        "input": 2,
        "output": 10,
        "cache_read": 0.1,
        "cache_write": 2.5,
        "unit": "USD per 1M tokens"
      },
      "groups": ["claude-value"]
    },
    {
      "id": "gpt-6.1-sol",
      "object": "model",
      "type": "model",
      "display_name": "GPT-6.1 Sol",
      "created": 1700000000,
      "created_at": "2025-01-01T00:00:00Z",
      "owned_by": "OpenAI",
      "context_length": 1050000,
      "pricing": {
        "input": 2,
        "output": 10,
        "cache_read": 0.1,
        "cache_write": null,
        "unit": "USD per 1M tokens"
      },
      "groups": ["gpt-value"]
    }
  ],
  "has_more": false,
  "first_id": "claude-fable-5.1",
  "last_id": "gpt-5.6-luna"
}
FieldMeaning
idThe model id to send. Other spellings also resolve; see Model ids.
owned_byThe vendor: Anthropic, OpenAI or Google.
context_lengthMaximum context window in tokens.
pricing.inputPrice of uncached input tokens.
pricing.outputPrice of output tokens, including reasoning and thinking tokens.
pricing.cache_readPrice of input tokens served from the prompt cache.
pricing.cache_writePrice of input tokens written to the prompt cache. null means cache writes are billed at the input price.
pricing.unitAlways USD per 1M tokens.
groupsChannel groups that serve the model.
created, created_atFixed placeholder values, present for SDK compatibility.

All prices are list prices before the channel group's multiplier. GET /v1beta/models returns the same models in Gemini's shape, without prices.

How a call is charged#

Each call's usage is split into four kinds of token, and each kind is billed at its own price:

Token kindAnthropic usage fieldOpenAI usage fieldGemini usage field
Uncached inputinput_tokensprompt_tokens minus cached_tokenspromptTokenCount minus cachedContentTokenCount
Cache readcache_read_input_tokensprompt_tokens_details.cached_tokenscachedContentTokenCount
Cache writecache_creation_input_tokensnot reportednot reported
Outputoutput_tokens (includes thinking)completion_tokens (includes reasoning)candidatesTokenCount + thoughtsTokenCount

The charge is:

Text
charge = ( uncached_input × input_price
         + cache_read     × cache_read_price
         + cache_write    × cache_write_price
         + output         × output_price ) ÷ 1,000,000 × multiplier

The multiplier is the one of the channel group that served the call, reported in the x-lovely-group response header. A model can carry its own multiplier, which then replaces the group's. Every group serving models today bills at ×1.00, so the listed prices are what you pay. Charges are rounded up to the nearest $0.000001.

For example, one turn of an agent session on claude-sonnet-5.5:

Token kindTokensPrice per 1MCost
Uncached input1,200$2.00$0.002400
Cache read30,000$0.10$0.003000
Cache write2,000$2.50$0.005000
Output800$10.00$0.008000
Total$0.018400

Without the cache, the same 33,200 input tokens would have cost $0.066400. See Prompt caching to keep cache hits high.

Image models#

Image models (gpt-image-*) are billed per image, not per token. In GET /v1/models their pricing is per_image (US dollars per image) instead of token prices. See Images pricing.

What is not charged#

  • Requests rejected before reaching a model: invalid key, model not allowed, insufficient balance, rate limit, invalid JSON.
  • Requests that fail on every channel, and failed attempts that were retried on another channel. You pay only for the attempt that answered.
  • POST /v1/messages/count_tokens and Gemini :countTokens.
  • Listing models.

Cancelled and interrupted streams#

If you close a stream early, you pay for the tokens produced up to that point. Input uses the count the stream reported, or about four characters per token of your request if it reported none. Output is the larger of the count reported so far and about four characters per token of the text already delivered to you.

A stream that the gateway cuts off because the model stopped responding is billed the same way, for what was delivered. See Streaming.

Where to see charges#

Every call appears in Logs with its token counts and charge. The marketplace shows each model's price per channel group with the multiplier already applied, plus live availability. Balance and top-ups are covered in Credits & billing; usage reports in Usage & logs.

Live price table#

ModelContextInputOutputCache readCache write

Live from GET /v1/models · USD per 1M tokens