API
One API, 350+ models.
OpenAI- and Anthropic-compatible. Make a request, get your answer and its receipt, and choose Private or Anonymous for each call with the model you pick.
- Base URL
- https://api.xanai.app/v1
- Auth
- Authorization: Bearer sk-…
- Tier
- set by the model: Private or Anonymous
- Billing
- xUSD per call, the tier fee included
xanai is an OpenAI-compatible API at https://api.xanai.app/v1. You pay per call in xUSD, which you top up with USDT, USDC or BNB on BNB Chain. Compare all models and their tiers or see per-message pricing in xUSD.
The full reference ships with the docs.
Response · sample
The answer and its receipt.
- id
- The receipt's ID. Look it up later, with its proof, at
GET /receipts/{id}. - request_hash
- The fingerprints of the prompt and of the answer (
response_hash). Your words never leave in them. - tier
- private or anon, set by the model you picked.
- cost
- What the call cost in xUSD, the tier fee included.
- attestation
- Private only: the enclave's signature for this call.
- root
- Pending until its minute is sealed on BNB, within 60 seconds; then the block.
200 OK · application/json
{
"id": "chat_7d1a2c",
"model": "deepseek-v3.2",
"choices": [{ "message": {
"role": "assistant",
"content": "Funding on Aster..." } }],
"usage": {
"input_tokens": 1380,
"output_tokens": 532 },
"receipt": {
"id": "rc_8f3a…c91e",
"request_hash": "0x8f3a…c91e",
"tier": "private",
"cost": "0.000732",
"attestation": "0x5e0c…a17d",
"root": {
"status": "pending",
"sealed_in_s": 42 }
}
}Routes
| POST | /chat/completions | Ask a model, OpenAI format. Returns the answer and its receipt. |
| POST | /messages | The same, Anthropic format. |
| GET | /models | The models, their tiers and prices in xUSD per 1M tokens. Public. |
| GET | /receipts/{id} | One receipt, its Merkle proof and the root's transaction on BNB. Public. |
| GET | /attestation/{id} | The enclave's attestation for a Private call. Public. |
| GET | /reserves | What backs the balances, asset by asset. Public. |
| GET | /keys/self | This key's budget and what it has spent. |
Errors
| 401 | The key is missing or revoked. |
| 402 | Not enough xUSD for this call. Nothing is charged. |
| 404 | No model with this id. |
| 429 | Too many requests at once. Wait and retry. |
| 503 | The model is not answering. Nothing is charged. |
Stuck on a call?Include the request ID, never your key.
Create your API key in the app.
Store it on your server and keep it out of your frontend code, public pages and app bundles.