Skip to content
XPNCORE

Documentation

Pricing API

Every model's price from GET /v1/pricing: list prices, or your group's with an API key.

GET /v1/pricing returns the price list as JSON for scripts, bots and resellers. List prices need no API key.

Send an API key to get exactly the models that key can call, at prices with your account's user group multiplier applied.

Key points

  • Endpoint: GET /v1/pricing; add ?model=<model ID> for one model.
  • Send the API key in the Authorization: Bearer header, or as ?key= when you cannot set headers.
  • Prices are in each model's currency, per 1 million tokens; amounts are strings.
  • pricing.multiplier is the group multiplier included in the prices; 1 is the list price.
  • Up to 60 requests a minute per IP address.

Pricing over the API#

GET /v1/pricing returns the price of every open model as JSON, so a script, a bot or a reseller can keep a price list up to date without reading the website.

  • Without an API key: list prices, as on the Models & pricing page.
  • With an API key: only the models that key can call, at your account's user group prices.

Prices are in each model's currency (usually VND), per 1 million tokens.

Try it#

List prices need no sign-in and no API key. Add ?model= to get one model only.

GET /v1/pricing
# Every model at list price
curl https://api.xpncore.com/v1/pricing

# One model
curl "https://api.xpncore.com/v1/pricing?model=MODEL_ID"

# The models your key can call, at your group's prices
curl https://api.xpncore.com/v1/pricing \
  -H "Authorization: Bearer $XPNCORE_API_KEY"
200 OK · GET /v1/pricing
{
  "object": "list",
  "group": { "name": "VIP", "price_multiplier": "0.9" },
  "peak_hours": {
    "time_zone": "Asia/Ho_Chi_Minh",
    "current_multiplier": null,
    "windows": [{ "days_of_week": [1, 2, 3, 4, 5], "start": "19:00", "end": "23:00", "multiplier": "1.2" }]
  },
  "price_windows": {
    "time_zone": "Asia/Ho_Chi_Minh",
    "current_multiplier": "0.7",
    "windows": [{ "label": "Off-peak", "days_of_week": [1, 2, 3, 4, 5, 6, 7], "start": "01:00", "end": "04:00", "multiplier": "0.7" }],
    "models": []
  },
  "data": [
    {
      "id": "MODEL_ID",
      "name": "Model name",
      "type": "model",
      "vendor": "openai",
      "table": "OpenAI",
      "availability": "available",
      "context_window": 400000,
      "max_output_tokens": 128000,
      "capabilities": ["vision", "tool_calling"],
      "pricing": {
        "currency": "VND",
        "unit": "token",
        "multiplier": "0.9",
        "input_per_million": "1080",
        "output_per_million": "1800",
        "cached_input_per_million": "540",
        "cache_write_per_million": null,
        "reasoning_per_million": null,
        "per_request": null,
        "min_charge_per_request": null,
        "per_image": null,
        "per_audio_second": null,
        "speech_per_million_chars": null,
        "audio_input_per_million": null,
        "audio_output_per_million": null,
        "range": null
      },
      "current_time_multiplier": "0.7",
      "aux_prices": [
        { "task": "image_input", "basis": "read", "currency": "VND", "min": "90", "max": "180" }
      ]
    }
  ]
}

Prices for your API key#

Send your key in the Authorization: Bearer header, as with any request. A tool that cannot set headers can pass ?key=, but URLs end up in browser history and logs, so prefer the header.

The answer then also has group: your group's name and its price multiplier. Each model's prices already include the group multiplier and the model's own ratio; pricing.multiplier tells you what was applied (1 is the list price).

Parameters#

All are query parameters and optional. Unknown parameters (a cache buster, say) are ignored.

modelstringOptional

A model ID as GET /v1/models or the Models page lists it. Returns that model only; an unknown model, or one your key cannot call, returns 404.

keystringOptional

Your API key, when you cannot send the Authorization header.

What you get back#

  • data[].id, name: the model ID to put in the model field, and its display name.
  • type: model or combo. vendor: who makes the model. table: the routing table it is listed under.
  • availability: available, degraded or unavailable. With context_window, max_output_tokens and capabilities.
  • pricing.currency: the currency. pricing.unit: how it is charged: token, request, token_request, unit (per image, audio second…) or range.
  • input_per_million, output_per_million: price per 1 million input and output tokens.
  • cached_input_per_million, cache_write_per_million: prompt cache read and write prices. null means no price of its own: cache tokens are charged as input tokens.
  • reasoning_per_million, per_request, min_charge_per_request, per_image, per_audio_second, speech_per_million_chars, audio_input_per_million, audio_output_per_million: other prices, when the model has them.
  • range: when unit is range (the price depends on the source serving the request, or on the combo member), the lowest and highest {min, max} of each price, with its basis.

Amounts are strings so no decimal digit is lost; convert them to numbers to do maths.

Peak hours#

peak_hours.windows lists the time windows with a price multiplier of their own for your group, in the peak_hours.time_zone time zone. days_of_week counts from 1 for Monday to 7 for Sunday.

A request that starts inside a window pays the listed price × that window's multiplier. While a window covers now, peak_hours.current_multiplier gives the multiplier in force.

Time-of-day prices#

price_windows lists the time-of-day windows every account pays, in the price_windows.time_zone zone: for example 01:00–04:00 30% cheaper (multiplier 0.7) and 18:00–22:00 20% dearer (multiplier 1.2). days_of_week numbers Monday 1 to Sunday 7; label names the window and may be empty.

  • A request pays the window in force when it is received and keeps it until it is billed. The multiplier moves token prices, the per-request price and the minimum charge; tool surcharges stay as they are.
  • It multiplies with your group's rate and peak hours.
  • data[].current_time_multiplier: what a request sent now pays (1 outside every window). The prices in pricing do not include it.
  • A model with its own hours, or one price all day, also has data[].time_window (mode is own or off) and appears in price_windows.models; a model without that field follows the site's windows.

Helper task prices#

A model that hands what it cannot do itself to helpers (reading images, documents, audio or video, drawing images…) has data[].aux_prices: each entry is a task (task), what a price counts (basis) and the min–max range, with the group multiplier like pricing.

  • basis: read per read, audio_second per second of audio, million_characters per 1M characters spoken, image per image or video unit, million_tokens per 1M input tokens.
  • Each piece of work costs the price of the source that did it; failed tries are free. Content read again from memory costs the lowest price in the range.
  • Time windows move these prices too. Without the field, reading costs the model's own price.

Limits and freshness#

  • Up to 60 requests a minute per IP address; past that you get 429.
  • Prices can change, so refresh regularly (every 5 to 10 minutes, say) instead of storing them for good. An answer without a key may be cached for 60 seconds; an answer for a key is never cached.
  • Each request is charged at the price in force when it is sent.

Common errors#

  • 401: the API key is wrong, revoked or expired.
  • 403: the key may not list models, or the IP is not allowed.
  • 404: no such model, or your key cannot call it.
  • 429: too many requests; wait a moment and retry.