Model Pricing Query
curl --request GET \
--url https://maas.gravitex.ai/prod-api/api/account/pricingimport requests
url = "https://maas.gravitex.ai/prod-api/api/account/pricing"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://maas.gravitex.ai/prod-api/api/account/pricing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://maas.gravitex.ai/prod-api/api/account/pricing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://maas.gravitex.ai/prod-api/api/account/pricing"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://maas.gravitex.ai/prod-api/api/account/pricing")
.asString();require 'uri'
require 'net/http'
url = URI("https://maas.gravitex.ai/prod-api/api/account/pricing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyInterface module
Model Pricing Query
Query available models, group discounts, base prices, and supported endpoints
GET
/
prod-api
/
api
/
account
/
pricing
Model Pricing Query
curl --request GET \
--url https://maas.gravitex.ai/prod-api/api/account/pricingimport requests
url = "https://maas.gravitex.ai/prod-api/api/account/pricing"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://maas.gravitex.ai/prod-api/api/account/pricing', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://maas.gravitex.ai/prod-api/api/account/pricing",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://maas.gravitex.ai/prod-api/api/account/pricing"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://maas.gravitex.ai/prod-api/api/account/pricing")
.asString();require 'uri'
require 'net/http'
url = URI("https://maas.gravitex.ai/prod-api/api/account/pricing")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyEndpoint details
| Item | Details |
|---|---|
| Base URL | https://maas.gravitex.ai/prod-api |
| Data format | application/json |
| Character encoding | UTF-8 |
| Protocol | HTTPS (required) |
| Currency | USD (US dollars) |
1. Authentication
Send a Bearer credential in the HTTP header. Use either of the following credentials.| Credential | Where to find it | Query scope |
|---|---|---|
| System access token | Console → Personal Settings → System Access Token | Entire account |
| API key | Console → Token Management. Keys usually start with sk-. | This key only |
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Use Bearer <credential> with either credential above. |
# Option 1. System access token
Authorization: Bearer <access_token>
# Option 2. API key
Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxx
2. Common response structure
{
"code": 200,
"msg": "操作成功",
"data": { }
}
| Field | Type | Description |
|---|---|---|
code | integer | Application status code. 200 indicates success. |
msg | string | Status message |
data | object | Response data. Returns null on failure. |
Application status codes
| Code | Description |
|---|---|
| 200 | Success |
| 401 | Authentication failed (missing, invalid, or disabled credential) |
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
GET /api/account/pricing
3.1 Query scope by credential
| Credential | Groups returned | Models returned |
|---|---|---|
| System access token | All groups available to the account | All models in the groups available to the account |
| API key | The group assigned to the key | Models in the key’s group. If the key has model restrictions, only allowed models are returned. |
3.2 Fields in data
| Field | Type | Description |
|---|---|---|
currency | string | Always USD |
tokenUnit | string | Always million. Token prices are per million tokens. |
groups | object[] | Available groups and discounts. See 3.3. |
supportedEndpoint | object | Endpoint types and request paths supported by the returned models. See 3.4. |
models | object[] | Available models and prices. See 3.5. |
tokenName | string | Name of the current API key. Returned only when an API key is used. |
3.3 groups (groups and discounts)
| Field | Type | Description |
|---|---|---|
group | string | Group identifier |
desc | string | Group description |
ratio | number | Group price multiplier. For example, 0.86 means 86% of the base price. |
For theautogroup, billing uses the multiplier of the group that handles the request. Theautoratio is for reference only.
3.4 supportedEndpoint (endpoint types)
Each key is an endpoint type and each value provides its request method and path.
{
"openai": { "method": "POST", "path": "/v1/chat/completions" },
"anthropic": { "method": "POST", "path": "/v1/messages" },
"openai-response": { "method": "POST", "path": "/v1/responses" },
"gemini": { "method": "POST", "path": "/v1beta/models/{model}:generateContent" }
}
supportedEndpointTypes to find their request paths.
3.5 models (models and prices)
| Field | Type | Description |
|---|---|---|
modelName | string | Model name to pass as the model parameter |
vendorName | string | Model provider |
billingType | integer | Billing type. See 3.8. |
enableGroups | string[] | Groups that can call the model |
supportedEndpointTypes | string[] | Supported endpoint types, mapped in supportedEndpoint |
billingMode | string | Always tiered_expr for tiered models. Returned only for tiered models. |
tierBasis | string[] | Criteria used to select a tier. Returned only for tiered models. See 3.7. |
prices | object | Model base prices, keyed by price item. See 3.6. |
pricingConfig | object | Detailed billing configuration returned for some image, video, and omnimodal models. See 3.8. |
3.6 prices (price items)
Token-based billing (USD per million tokens)
| Price item | Description |
|---|---|
textInputTokens | Text input |
textOutputTokens | Text output |
cacheTokens | Cache reads (cache hits) |
cacheCreationTokens5m | Cache writes (5 minutes) |
cacheCreationTokens1h | Cache writes (1 hour) |
imageInputTokens | Image input |
imageOutputTokens | Image output |
audioInputTokens | Audio input |
audioOutputTokens | Audio output |
videoInputTokens | Video input |
videoOutputTokens | Video output |
| Price item | Unit |
|---|---|
perRequest | USD per request |
seconds | USD per second |
imageCount | USD per image |
inputTokens without the text prefix.
| Suffix | Meaning | Example |
|---|---|---|
Lte | Less than or equal to | inputTokensLte272K applies to input of 272K or less |
Lt | Less than | inputTokensLt200K |
Gte | Greater than or equal to | inputTokensGte200K |
Gt | Greater than | textOutputTokensGt272K is the output rate for the tier above 272K |
| Range | Lower bound first, then upper bound | inputTokensGt32KLte128K covers more than 32K and up to 128K |
Peak / OffPeak | Peak / off-peak hours | inputTokensPeak, inputTokensOffPeak |
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.
| tierBasis | Basis | What determines the tier |
|---|---|---|
context | Context length | Total input context length, including cache hits |
input | Input | Text input tokens, excluding cache, images, audio, and other separately priced items |
output | Output | Output tokens for the request |
time | Time of day | Request time (Beijing time) |
- 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 inGt272K. Input, output, and cache use their correspondingxxxGt272Krates.
- For a model with
- 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).
- With 200K new input tokens and 100K cache hits, context length is 300K (
- All listed criteria must match when multiple criteria appear, such as
["input", "output"]. - Time-based pricing takes two forms.
priceslists bothxxxPeakandxxxOffPeakrates for peak and off-peak hours.priceslists the base rate only. A multiplier applies during peak hours. Contact your account manager for hours and multipliers.
3.8 billingType (billing types)
| billingType | Description | prices | pricingConfig |
|---|---|---|---|
| 0 | Per token | Token price items, with tier suffixes for tiered models | None |
| 1 | Per request | perRequest | None |
| 2 | Image billing per token | Empty | Image token rates (USD per million tokens) |
| 3 | Video billing per second | seconds when a flat rate applies | Rates that vary by resolution, audio inclusion, and other factors |
| 4 | Omnimodal billing | Empty | Rates for text, images, audio, and other modalities |
| 5 | Per image | imageCount when a flat rate applies | Rates that vary by reference image count, output size, and other factors |
| 6 | Video billing per token | Token price items, including videoOutputTokens | Rates that vary by resolution, video input inclusion, and other factors |
The pricingConfig structure varies by model. Refer to the API response for the actual configuration.
3.9 Effective unit price
Effective unit price = base price in prices × group ratio
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.{
"code": 200,
"msg": "操作成功",
"data": {
"currency": "USD",
"tokenUnit": "million",
"groups": [
{ "group": "default", "desc": "默认分组", "ratio": 1.0 },
{ "group": "auto", "desc": "自动", "ratio": 1.0 },
{ "group": "Anthropic", "desc": "Anthropic", "ratio": 0.86 }
],
"supportedEndpoint": {
"openai": { "method": "POST", "path": "/v1/chat/completions" },
"anthropic": { "method": "POST", "path": "/v1/messages" },
"openai-response": { "method": "POST", "path": "/v1/responses" }
},
"models": [
{
"modelName": "claude-fable-5-2",
"vendorName": "Anthropic",
"billingType": 0,
"enableGroups": ["Anthropic", "default"],
"supportedEndpointTypes": ["openai", "anthropic"],
"prices": {
"textInputTokens": "8",
"textOutputTokens": "40",
"cacheTokens": "0.2",
"cacheCreationTokens5m": "10"
}
},
{
"modelName": "gpt-5.4",
"vendorName": "OpenAI",
"billingType": 0,
"enableGroups": ["default"],
"supportedEndpointTypes": ["openai", "openai-response"],
"billingMode": "tiered_expr",
"tierBasis": ["context"],
"prices": {
"inputTokensLte272K": "2.5",
"textOutputTokensLte272K": "15",
"cacheTokensLte272K": "0.25",
"inputTokensGt272K": "5",
"textOutputTokensGt272K": "22.5",
"cacheTokensGt272K": "0.5"
}
},
{
"modelName": "grok-imagine-image",
"vendorName": "xAI",
"billingType": 1,
"enableGroups": ["default"],
"supportedEndpointTypes": ["openai-images"],
"prices": { "perRequest": "0.02" }
}
]
}
}
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
# Query model prices
curl -s "https://maas.gravitex.ai/prod-api/api/account/pricing" \
-H "Authorization: Bearer <access_token>"
5. Notes
- Refresh interval. Price changes take effect within about one minute.
- Base prices. Multiply the model’s base price in
pricesby the applicable group’sratioto calculate the effective rate. - Final charges. Use the endpoint for queries and estimates. Refer to your bill for final charges.
- 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.
