Skip to main content
GET
Model Pricing Query

Endpoint details

This endpoint takes no request parameters. Send the authorization header with each request.

1. Authentication

Send a Bearer credential in the HTTP header. Use either of the following credentials.
Authentication fails if the credential is missing, invalid, deleted, or disabled, or if the account is disabled.

2. Common response structure

Application status codes

Check code in the response body to determine whether the request succeeded.

Amount format

  • All amounts are in US dollars (USD) and are returned as strings to avoid loss of floating-point precision.
  • Balance amounts always have four decimal places, for example "986.9275".
  • Model unit prices have no zero padding, for example "40", "2.5", and "0.00075".

3. Model pricing query

3.1 Query scope by credential

3.2 Fields in data

3.3 groups (groups and discounts)

For the auto group, billing uses the multiplier of the group that handles the request. The auto ratio is for reference only.

3.4 supportedEndpoint (endpoint types)

Each key is an endpoint type and each value provides its request method and path.
This map contains only endpoint types used by the returned models. Look up the types listed in each model’s supportedEndpointTypes to find their request paths.

3.5 models (models and prices)

3.6 prices (price items)

Token-based billing (USD per million tokens) Billing per request, second, or image Tiered price items append a tier suffix to these keys. For text input, the tiered key uses inputTokens without the text prefix. K means a thousand tokens and M means a million. For example, 272K is 272,000 tokens and 1M is 1,000,000 tokens.

3.7 tierBasis (tier selection criteria)

Models can use different criteria for the same suffix, such as Lte272K. Check tierBasis to see which criteria apply. Billing rules
  1. One tier applies to the whole request. Determine the tier from the request’s usage. Input, output, cache, and other items all use rates from that tier, with no progressive billing across tiers.
    • For a model with tierBasis = ["context"], a 300K context falls in Gt272K. Input, output, and cache use their corresponding xxxGt272K rates.
  2. Context length includes cache hits. Text input excludes them.
    • With 200K new input tokens and 100K cache hits, context length is 300K (Gt272K) and text input is 200K (Lte272K).
  3. All listed criteria must match when multiple criteria appear, such as ["input", "output"].
  4. Time-based pricing takes two forms.
    • prices lists both xxxPeak and xxxOffPeak rates for peak and off-peak hours.
    • prices lists the base rate only. A multiplier applies during peak hours. Contact your account manager for hours and multipliers.

3.8 billingType (billing types)

The pricingConfig structure varies by model. Refer to the API response for the actual configuration.

3.9 Effective unit price

For a model with textInputTokens of "8" used in a group with ratio = 0.86, the effective input price is 8 × 0.86 = $6.88 per million tokens.

3.10 Example response

This example shows part of the response.
When you use an API key, groups contains only the key’s group and models contains only the models available to that group. The response also includes tokenName.

4. Request examples


5. Notes

  1. Refresh interval. Price changes take effect within about one minute.
  2. Base prices. Multiply the model’s base price in prices by the applicable group’s ratio to calculate the effective rate.
  3. Final charges. Use the endpoint for queries and estimates. Refer to your bill for final charges.
  4. Credential security. Keep system access tokens private because they provide access to account-wide information. To query one key’s quota, use that API key.