Skip to content
Lumean

AI API: prices and spending

How the price of an AI API request is calculated, where to find a model's current price, how to check it before a request and how to spend less.

AI API requests are paid from the LUMC balance. Subscription tokens and quotas aren't spent here. You're charged at the model's price at the time of the request.

How the price is calculated

A model has one of two schemes, and the catalog shows which:

  • Per token is for language models. The price is given per 1 million tokens, separately for each class: input (input), cached input (cached_input), cache write (cache_write), output (output) and reasoning (reasoning). The request's usage is in the usage field of the response.
  • Per call is for image models. One price per image at any size and quality.

A failed request that the model didn't answer isn't charged.

Prices change

We take models from providers, and their prices change, sometimes several times a day. The price in Lumean follows them up and down automatically and without notice. A model can also disappear for a while: then the request gets 404 model_not_found or model_disabled, or 429 provider_keys_cooling.

So build the client to:

  1. Check the price before an expensive request against your own threshold, and not send the request if the price is higher.
  2. Cope without a model: on 404 and 429, switch to a fallback model or postpone the task instead of retrying in a loop.
  3. Work with the key's monthly limit. The limit is set in the key settings in My API keys and stops spending even if the price rose between the check and the request.

Current prices

GET /api/public/ai/models returns all available models with prices, and GET /api/public/ai/models/{key} returns one. key is the same name as in the request's model field. Any active key works, and the key's permissions aren't needed. Pass the key in the X-API-KEY header.

curl -s "https://api.lumean.app/api/public/ai/models/gpt-image-2.5" \
  -H "X-API-KEY: $LUMEAN_API_KEY"
{
  "success": true,
  "data": {
    "version": "9f2c…",
    "models": [{
      "key": "gpt-image-2.5",
      "name": "GPT Image 2.5",
      "kind": "image",
      "price": {
        "input":  {"per_mtok_minor": 0, "per_mtok_formatted": 0, "per_mtok_display": 0},
        "output": {"per_mtok_minor": 0, "per_mtok_formatted": 0, "per_mtok_display": 0},
        "request": {"per_call_minor": 1857868, "per_call_formatted": 0.01857868, "per_call_display": 0.002254}
      },
      "billing_available": true,
      "context_window": null,
      "max_output_tokens": null,
      "capabilities": {
        "image_output": true,
        "image_options": {"size": ["auto", "1024x1024", "1536x864", "864x1536"]}
      }
    }],
    "asset": {"code": "LUMC", "precision": 8},
    "display_currency": {"code": "USD", "symbol": "$", "precision": 2, "available": true}
  }
}
FieldWhat it means
price.<class>.per_mtok_formattedThe price per 1 million tokens of this class, in LUMC
price.request.per_call_formattedThe price per call in LUMC (images)
*_minorThe same in minimal units: LUMC = minor / 10^asset.precision
*_displayThe same price in the display_currency currency, for reference. You can set the currency with the X-Display-Currency: USD header. null means there's no rate right now
billing_availablefalse or price: null means the model can't be called for pay right now
capabilities.image_optionsAllowed image sizes, see AI API: images

You're always charged in LUMC, and *_display is only a guide. A model that can't be served right now isn't in the list, and /models/{key} answers 404 for it.

GET /v1/models doesn't return prices, only the model list and the models' limits.

Checking the price before every request

The catalog response is always fresh. version and the ETag header change along with the prices. If you send a request with the If-None-Match: <ETag> header, then as long as prices are unchanged, you get 304 with no body. You can do this check before every request.

import requests

BASE = "https://api.lumean.app/api/public/ai/models"
etag, price = None, None

def current_price(model: str, key: str):
    global etag, price
    headers = {"X-API-KEY": key, **({"If-None-Match": etag} if etag else {})}
    r = requests.get(f"{BASE}/{model}", headers=headers, timeout=10)
    if r.status_code == 304:
        return price                       # the price hasn't changed
    r.raise_for_status()                   # 404 means the model isn't available now
    etag = r.headers["ETag"]
    data = r.json()["data"]
    m, asset = data["models"][0], data["asset"]
    price = m["price"]["request"]["per_call_minor"] / 10 ** asset["precision"]
    return price

if current_price("gpt-image-2.5", KEY) > MAX_LUMC_PER_IMAGE:
    raise RuntimeError("Price is above the threshold, not sending the generation")

The check doesn't lock the price. If the price changes within seconds between the check and the request, you're charged the new one. Your threshold and the key's monthly limit protect you from this.

Why a long conversation gets more expensive

The model doesn't remember earlier requests. The client sends the whole conversation again every time: the system prompt, tool descriptions, all earlier messages, responses and screenshots. So "hi" in a new conversation costs pennies, while the same "hi" in a long conversation is billed as the whole history before it.

The cache makes this cheaper. The part of the conversation that was already read is billed at the cached_input rate, which is several times lower than regular input. But the cache doesn't live long: 5 minutes for Claude models, and for the others as long as the provider keeps it. After a longer pause, the conversation is read again at the full rate.

The model's reasoning is billed as output tokens, at the reasoning rate, or at the output rate if there isn't one. Output is the most expensive class, so reasoning effort noticeably affects the price. How to set it is in AI API: connecting and requests.

How to spend less

  1. A new task is a new conversation. The old history stops traveling with every request.
  2. Don't keep extra stuff in the conversation. Large files, screenshots and logs are resent with every following request.
  3. Don't change reasoning effort mid-conversation. Changing parameters resets the cache, and the next request will reread the conversation at the full rate.
  4. Simple tasks go to simple models, with low reasoning effort.
  5. Watch usage. For one question from you, an agent often makes several requests to the model, and the counter in the app shows their sum.

This page for AI

Open .mdllm.md

Updated 12/01/2026 · API version 1.0.0