Provider Pricing API Markdown
Complete wire contract for relay provider pricing feeds.
XTokenChecker / Hvoy compatible provider pricing schema
Protocol
- Recommended path:
GET /api/provider/pricing - JSON schema versions:
1.0and1.1 - Currency:
CNY - Default units:
per_1m_tokensorper_call - Match key:
model_name + group_name - Numbers must be JSON numbers, never numeric strings
- Unknown prices must be
null, never an empty string - A missing channel means “not matched”, not “disabled”
- Use
enabled: falsefor a known channel that is temporarily unavailable
Fields
| Field | Required | Meaning |
|---|---|---|
schema_version | yes | 1.0 or 1.1 |
success | yes | Request result |
message | no | Error or diagnostic message |
data.currency | yes | Must be CNY |
data.price_unit | yes | Default unit |
data.updated_at | yes | ISO 8601 timestamp with timezone |
data.models | yes | Model/channel price rows |
model_name | yes | Stable machine model ID |
group_name | yes | Stable channel/group ID |
price_unit | no | Overrides the document default |
input_price | token pricing | CNY per 1M input tokens |
output_price | no | CNY per 1M output tokens |
cache_input_price | no | Cache read/hit price |
cache_create_price | no | Cache write price; Claude 5-minute write |
cache_create_price_1h | no | Claude 1-hour cache write price |
unit_price | call pricing | CNY per call |
enabled | no | Defaults to true |
note | no | Display-only note |
Mixed billing example
{
"schema_version": "1.1",
"success": true,
"message": "",
"data": {
"currency": "CNY",
"price_unit": "per_1m_tokens",
"site_name": "example",
"site_domain": "example.com",
"updated_at": "2026-07-15T00:00:00Z",
"models": [
{
"model_name": "claude-opus-4-8",
"group_name": "official",
"input_price": 10,
"output_price": 50,
"cache_input_price": 1,
"cache_create_price": 12.5,
"cache_create_price_1h": 20,
"enabled": true,
"note": ""
},
{
"model_name": "gpt-image-2",
"group_name": "image",
"price_unit": "per_call",
"unit_price": 0.2,
"enabled": true,
"note": ""
}
]
}
}Signing
Optional request headers:
X-Hvoy-Ts: 1784073600
X-Hvoy-Sign: lowercase_hex_hmac_sha256sign = hex(HMAC-SHA256(auth_secret, ts))Reject timestamps outside a 60-second window. The public tester signs with hvoy_provider_pricing_test_secret_v1_20260522.
Validation
- Duplicate
model_name + group_namerows are invalid. - Token-priced rows require
input_price. - Call-priced rows require
unit_price > 0. - Prices cannot be negative.
- Keep stable IDs stable; changing
group_namecreates a new channel.