X402 Pricing Explanation
This document explains how pricing is determined when calling the Ace Data Cloud API with X402, and how it relates to the platform's standard Credits pricing.
¶ Key Conclusion
X402 is not an independent pricing system. Each API call already has a cost denominated in Credits, which is the single pricing source shared by all billing methods (API Token credit deduction, account balance, X402 on-chain payment). X402 simply converts this Credits cost into on-chain USDC at a fixed exchange rate:
1 Credit = 0.095215 USDC (i.e.,
95215atomic USDC, with USDC having 6 decimal places)
That is:
X402 price (USDC) = Credits cost of the call × 0.095215
This exchange rate is not set arbitrarily; it equals the platform's best-tier (bulk) Credits unit price. Therefore, paying with X402 ≈ buying Credits at the best-tier unit price and then consuming them, with no X402 premium. Instead, you directly enjoy the lowest Credits unit price, with no need for prepaid top-ups or an API Token.
¶ Pricing Basis
| Item | Value | Description |
|---|---|---|
| Conversion rate | 1 Credit = 0.095215 USDC |
A fixed exchange rate uniformly set by the platform |
| atomic unit | 1 Credit = 95215 atomic USDC |
USDC has 6 decimal places, atomic = floor(credits × 0.095215 × 1e6) |
| Minimum charge | 1 atomic USDC ($0.000001) |
Even if the cost is extremely low, at least 1 atomic is settled |
| Pricing currency | USDC | Base uses ERC-20 USDC, Solana uses SPL USDC |
Conversion is performed uniformly by the platform, and the amount is the same across all supported networks (Base, Solana); different networks only differ in asset contracts and signing methods, while the price remains the same.
¶ Relationship with Standard Credits Unit Prices
Platform Credits are sold in tiers where “the greater the usage, the lower the unit price.” When X402 charges per call, it uniformly uses the best-tier unit price:
| Purchase/payment method | Approximate Credits unit price | Description |
|---|---|---|
| Entry-level / small top-up | Approximately $0.13 / Credit |
List price, the unit price when buying Credits in small amounts |
| Bulk / best tier | $0.095215 / Credit |
The lowest unit price |
| X402 pay per call | $0.095215 / Credit |
Always equal to the best-tier unit price |
In other words, X402 settles every call at the best-tier Credits unit price. Users who buy Credits through small top-ups pay a higher unit price than X402; only bulk top-up users have the same unit price as X402.
¶ Two Pricing Forms: exact and upto
In an X402 402 response, maxAmountRequired is the amount you need to sign. It has two forms:
exact(fixed price): The price can be determined before processing the request (images, videos, music, search, order payments).maxAmountRequired = Credits cost of the call × 0.095215, which is the amount payable for that call (consistent withcost.amountin the successful response).upto(post-usage metering): For APIs such as chat completions where “the number of tokens used is known only after the response ends.”maxAmountRequiredis an upper limit (converted from the limit Credits configured for that model: limit Credits × 0.095215), while actual settlement is based on real usage and does not exceed the upper limit.
For protocol details about these two schemes, see the exact and upto billing schemes. Only pricing is discussed below.
¶ Chat (Chat Completion) Pricing
Chat completions use upto metering: charges are based on actual prompt / completion token usage. The price per million (1M) tokens = the model's Credits cost per 1M tokens × 0.095215, which is fully consistent with the USD unit prices displayed in the platform's public model catalog (/api/v1/models?with_pricing=true).
The table below shows actual prices (taken from the model catalog and calculated at the X402 exchange rate), in USD / 1M tokens:
| Model | Input / 1M | Output / 1M | upto limit |
|---|---|---|---|
| gpt-4o-mini | $0.0796 | $0.3183 | 1 Credit ($0.095215) |
| gemini-2.5-flash | $0.1591 | $1.3262 | 5 Credits ($0.476074) |
| gpt-5 / gpt-5.1 | $0.6631 | $5.3050 | 20 Credits ($1.904299) |
| gemini-2.5-pro | $0.6631 | $5.3050 | 50 Credits ($4.760750) |
| gpt-4.1 | $1.0610 | $4.2440 | 20 Credits ($1.904299) |
| claude-sonnet-4-5 | $0.6006 | $3.0028 | 50 Credits ($4.760750) |
| grok-4 | $1.5915 | $7.9574 | 10 Credits ($0.952149) |
| claude-opus-4-1 | $3.0028 | $15.0140 | 50 Credits ($4.760750) |
Notes:
- The table shows token-metered unit prices; the cost of one request = input tokens × input unit price + output tokens × output unit price.
- The
uptolimit is the maximum amount allowed to be signed for one request for that model; it is not the actual charge, and the vast majority of requests are far below the limit. - The limit only determines “the maximum possible charge”; actual settlement is calculated based on token usage.
¶ Example: Quote and Charge Are Consistent (exact)
Below is a real paid call made to serp/google using the official X402Client (Base exact). It demonstrates the consistency of all three: the 402 quote, the signed amount, and the cost returned in the successful response.
# 1) Unpaid request -> 402, obtain quote (no charge)
POST /serp/google -> 402
base/exact maxAmountRequired = 952 atomic = $0.000952 = 0.01 Credit
# 0.01 × 0.095215 = 0.00095215, rounded down to atomic = 952
# 2) Sign a PAYMENT-SIGNATURE for 952 atomic with the wallet, then retry
POST /serp/google (PAYMENT-SIGNATURE) -> 200
body.cost = {"amount": 0.000952, "currency": "usdc", "settlement": "authorized"}
The returned cost.amount (0.000952 USDC) is fully consistent with the 402 quote and with Credits × 0.095215. The settlement field is the settlement status of this payment (authorized = authorized); on-chain settlement is handled by the platform, see the mechanism in the exact and upto billing schemes.
¶ upto Quote Calculation (Chat)
Chat is metered by tokens. The quote for a request (not the cap) is calculated as follows (using gpt-4o-mini as an example):
Credits = 1e-6 × (0.835733 × prompt_tokens + 3.342933 × completion_tokens)
USDC = Credits × 0.095215
A request with 500 prompt + 200 completion tokens:
Credits = 1e-6 × (0.835733 × 500 + 3.342933 × 200) ≈ 0.001086 Credits
Quoted USDC ≈ 0.001086 × 0.095215 ≈ $0.0001034
The client signs according to the upto cap (for gpt-4o-mini, 1 Credit = 95215 atomic), which is only the maximum amount that may be charged; the actual quote for this request (approximately $0.0001 in the example above) is far below the cap and is settled according to token usage. For the on-chain settlement mechanism of upto, see the exact and upto billing schemes.
¶ Other Service Prices (Fixed-price exact)
For APIs such as images, videos, music, and search, the price can be determined at the time of the request, and exact is used. The table below shows actual prices, taken from the 402 maxAmountRequired returned by the live APIs for unpaid requests (querying a quote does not incur charges):
| Service | Example Model / Parameters | Credits | USDC | atomic |
|---|---|---|---|---|
| Web Search | serp/google, ≤10 results | 0.01 | $0.000952 | 952 |
| Image | nano-banana | 0.14 | $0.013330 | 13330 |
| Image | gpt-image-1, 1024×1024 | 0.20 | $0.019043 | 19043 |
| Image | flux-dev | 0.24 | $0.022851 | 22851 |
| Image | midjourney imagine | 0.27 | $0.025708 | 25708 |
| Image | seedream-4 | 0.32 | $0.030468 | 30468 |
| Music | suno generate | 0.55 | $0.052368 | 52368 |
| Music | producer generate | 0.68 | $0.064746 | 64746 |
| Video | luma | 1.19 | $0.113305 | 113305 |
| Video | hailuo (minimax-hailuo-2-3) | 1.72 | $0.163769 | 163769 |
| Video | kling-v2-6 std | 2.10 | $0.199951 | 199951 |
| Video | kling-v3 std | 4.20 | $0.399903 | 399903 |
| Video | veo-3 text→video | 5.00 | $0.476074 | 476074 |
| Video | seedance-1-0-pro, 1080p / 5s | 5.60 | $0.533204 | 533204 |
| Video | wan2.6-t2v | 13.50 | $1.285402 | 1285402 |
Notes:
- The price of the same service varies with model, resolution, duration, and actions (especially for video). The table above shows actual values for one set of parameters and is for reference on the order of magnitude only.
- For these fixed-price (
exact) APIs, themaxAmountRequiredin the 402 response for that request is the amount payable for that request (consistent withcost.amountin the successful response, as verified in the previous section). - Each price is obtained by rounding down
Credits × 0.095215to the atomic unit (see the pricing basis above), using the same conversion as chat. Due to floating-point representation and rounding, individual values may differ from the naive product by 1 atomic ($0.000001); the 402 return value shall always prevail.
¶ Order Payment Prices
When paying for console orders with X402 (purchasing plans / topping up Credits), the price displayed on the order page shall prevail, and the 402 amount is the final basis for signing. Order payments go through the platform API and require an account token; see the order payment tutorial for details.
A real example from the order payment tutorial (purchasing 10 Credits):
description Ace Data Cloud Credits x 10.0
created price 1.26 # Order creation price (USD)
settled 1.20 USDC # Final signing/settlement amount (= 402 amount)
= 1200000 atomic USDC
Note: pay-per-call (Chat / other services above) and order payment are two different paths. Pay-per-call uniformly uses the optimal-tier unit price of 0.095215/Credit; order payment is priced by plan, and the difference between its creation price and final settlement amount is subject to the order payment tutorial.
¶ How to Obtain Prices in Real Time
Prices vary with models and parameters. Please obtain them in real time programmatically rather than hardcoding them:
- Pay-per-call price: Send a request to the target API without
PAYMENT-SIGNATURE(and withoutAuthorization), then read the returned 402accepts[].maxAmountRequired. This step does not incur charges. ForexactAPIs, it is the final price; foruptoAPIs (chat), it is the cap, while the actual amount is settled based on usage. - Chat per-token unit price:
GET https://platform.acedata.cloud/api/v1/models?with_pricing=true&type=chat, then readpricing.input_usd/pricing.output_usdfor each model (already calculated usingcredit_usd_rate). - Conversion validation:
atomic = floor(Credits × 0.095215 × 1e6),USDC = atomic / 1e6(that is,USDC ≈ Credits × 0.095215).
Minimal example request for obtaining a price:
curl -sS -X POST https://x402.acedata.cloud/midjourney/imagine \
-H 'Content-Type: application/json' \
-d '{"prompt": "a cat"}'
# Returns 402; accepts[].maxAmountRequired is the price for this (exact) call
¶ Summary
- X402 price = the Credits cost of that call ×
0.095215, which is the same price as regular Credits billing, except that it is settled with on-chain USDC. 0.095215/Credit is the platform's best-tier (large-volume) Credits unit price; purchasing Credits with small top-ups has a higher unit price, so X402 automatically gets the best unit price.- For
exactAPIs (image / video / music / search / order), the signed amount is the amount payable for that call; foruptoAPIs (chat), the signed amount is the upper limit, and settlement is based on actual usage. - The authoritative price is based on the
maxAmountRequiredreturned by 402: forexact, it is the payable amount (consistent withcost.amountin the successful response, verified through testing); forupto, it is the upper limit, andcost.amountin the successful response is the actual amount settled based on usage (≤ upper limit).
¶ Related Documentation
| Document | Link |
|---|---|
| X402 Integration Guide (Overview) | X402 Integration Guide |
| Quick Start | X402 Quick Start |
exact and upto Billing Schemes |
Billing Scheme Description |
| Networks and Payment Methods | Networks and Payment Methods |
| Order Payment Tutorial | Order Payment Tutorial |
