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.0 and 1.1
  • Currency: CNY
  • Default units: per_1m_tokens or per_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: false for a known channel that is temporarily unavailable

Fields

FieldRequiredMeaning
schema_versionyes1.0 or 1.1
successyesRequest result
messagenoError or diagnostic message
data.currencyyesMust be CNY
data.price_unityesDefault unit
data.updated_atyesISO 8601 timestamp with timezone
data.modelsyesModel/channel price rows
model_nameyesStable machine model ID
group_nameyesStable channel/group ID
price_unitnoOverrides the document default
input_pricetoken pricingCNY per 1M input tokens
output_pricenoCNY per 1M output tokens
cache_input_pricenoCache read/hit price
cache_create_pricenoCache write price; Claude 5-minute write
cache_create_price_1hnoClaude 1-hour cache write price
unit_pricecall pricingCNY per call
enablednoDefaults to true
notenoDisplay-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_sha256
sign = 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_name rows 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_name creates a new channel.