Model status & pricing API
Two unauthenticated JSON endpoints: /api/provider/status reports the live availability of every model in every group, /api/provider/pricing returns the public price list that matches the model square. Use them for status dashboards, automatic model fallback, cost estimation or third-party listings.
Both endpoints are served on the console host and on every API endpoint, e.g. https://cn.chatapi.app/api/provider/status or https://www.xycai.us/api/provider/status. No Authorization header is needed; cache results for at least a minute instead of polling tightly.
1. Model status GET /api/provider/status
Enumeration matches the pricing list: one record per model × pricing group (the same model in Enterprise and Economy is two records). Models covered by probes report probe-derived states; models without probes are reported as operational with probed: false.
Request
curl https://cn.chatapi.app/api/provider/status
Python:
import requests
data = requests.get("https://cn.chatapi.app/api/provider/status", timeout=10).json()["data"]
print(data["summary"])
bad = [m for m in data["models"] if m["current_status"] != "operational"]
for m in bad:
print(m["group_name"], m["model_name"], m["current_status"], m.get("current_rate"))
Response
{
"schema_version": "1.0",
"success": true,
"message": "",
"data": {
"site_name": "XycAi",
"generated_at": "2026-10-21T23:36:47Z",
"window_hours": 24,
"summary": {
"total": 285,
"probed": 31,
"status": { "operational": 263, "degraded": 22, "outage": 0 },
"current_status": { "operational": 284, "degraded": 0, "outage": 1 }
},
"models": [
{
"model_name": "claude-opus-5-5",
"group_name": "Claude 企业版",
"status": "operational",
"current_status": "operational",
"probed": true,
"rate_24h": 100,
"current_rate": 100,
"last_check": 1792625400,
"note": "status: 24h probe success rate ... current_status: latest 30-minute probe bucket ..."
},
{
"model_name": "claude-2",
"group_name": "Claude 工作流",
"status": "operational",
"current_status": "operational",
"probed": false,
"note": "No probe coverage for this model; reported as operational."
}
]
}
}
Fields
| Field | Type | Meaning |
|---|---|---|
data.window_hours | int | Statistics window, fixed at 24 hours |
data.summary.total / probed | int | Number of records / how many have probe coverage |
data.summary.status / current_status | object | Counts per state under each of the two definitions |
model_name / group_name | string | Model name (the request model) and the display name of its pricing group |
status | enum | 24-hour view: probe success rate over the last 24h — ≥99% operational, ≥50% degraded, <50% outage |
current_status | enum | Live view: the latest 30-minute probe bucket with data — ≥99% operational, >0% degraded, 0% outage. Same colouring as the model square |
probed | bool | Probe coverage. When false both states are fixed to operational and the rate_* / last_check fields are absent |
rate_24h / current_rate | number | 24h success rate / latest-bucket success rate, in percent (0–100) |
last_check | int | Start of the latest probe bucket, Unix seconds |
For automatic fallback (switch model / group on failure) use current_status; for stability assessment use status and rate_24h. If the probe store cannot be read the endpoint returns HTTP 500 with success: false rather than pretending everything is green — treat that as "unknown", not "all down".
2. Public price list GET /api/provider/pricing
Returns the current final public prices (group discounts already applied) in CNY, identical to the model square. Enumeration is again model × visible group.
curl https://cn.chatapi.app/api/provider/pricing
{
"schema_version": "1.1",
"success": true,
"data": {
"currency": "CNY",
"price_unit": "per_1m_tokens",
"updated_at": "2026-10-21T23:36:56Z",
"models": [
{
"model_name": "claude-fable-5",
"group_name": "Claude 企业版",
"input_price": 26.91,
"output_price": 134.55,
"cache_input_price": 2.691,
"cache_create_price": 26.91,
"enabled": true,
"note": "Final public price in CNY per 1M tokens, matching the model square."
},
{
"model_name": "gpt-image-2.5-flare",
"group_name": "GPT 企业版",
"price_unit": "per_call",
"unit_price": 0.1,
"enabled": true,
"note": "按张计价:1K / 2K / 4K 全档同价 ¥0.1 每张。"
}
]
}
}
| Field | Meaning |
|---|---|
data.currency / price_unit | Global units: CNY, per 1M tokens for token-billed models |
input_price / output_price | Input / output price (¥ per 1M tokens) |
cache_input_price / cache_create_price / cache_create_price_1h | Cache read / cache write (5 min) / cache write (1 h) prices; only present for models with prompt caching |
price_unit: "per_call" + unit_price | Per-call models (images per picture, video per second); note explains the unit and tiers |
enabled | Whether the model can currently be ordered |
Account tiers (T1 / T2 / V1 …) and time-of-day discounts are not reflected here; the model square shows your account's actual prices once logged in.
3. Joining both lists
(model_name, group_name) is the shared key, so a "price + availability" view is one join away:
import requests
BASE = "https://cn.chatapi.app"
price = {(m["model_name"], m["group_name"]): m for m in requests.get(BASE + "/api/provider/pricing").json()["data"]["models"]}
for s in requests.get(BASE + "/api/provider/status").json()["data"]["models"]:
p = price.get((s["model_name"], s["group_name"]), {})
print(s["model_name"], s["group_name"], s["current_status"], p.get("input_price"), p.get("output_price"))
To list the models your key can reach, use the authenticated GET /v1/models instead (see Models).
