Skip to main content
This document explains how the pricing is determined when calling the Ace Data Cloud API using X402, and how it relates to the regular Credits pricing on the platform.

Core Conclusion

X402 is not an independent pricing system. Each API call inherently has a cost measured in Credits, which is the only source of pricing shared across all billing methods (API Token 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., 95215 atomic USDC, USDC is 6 decimal places)
In other words:
This exchange rate is not arbitrarily set; it equals the platform’s optimal tier (bulk) Credits unit price. Therefore, paying with X402 is approximately equivalent to purchasing Credits at the optimal tier price and then consuming them, with no X402 premium, instead directly enjoying the cheapest Credits unit price, without needing to pre-charge or use an API Token.

Pricing Basis

The conversion is uniformly completed by the platform, and the amounts are consistent across all supported networks (Base, SKALE, Solana); different networks only differ in asset contracts and signature methods, with the same price.

Relationship with Regular Credits Unit Price

Platform Credits are sold in a tiered manner where “the larger the usage, the lower the unit price.” When billing by call, X402 uniformly uses the optimal tier unit price: In other words, X402 settles each call at the optimal tier Credits unit price. Users who buy Credits with small recharges will have a higher unit price than X402; only users with large recharges will have a unit price that matches X402.

Two Pricing Forms: exact and upto

In the 402 response of X402, 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 payment). maxAmountRequired = The Credits cost of this call × 0.095215, which is the amount payable for this call (consistent with cost.amount in the successful response).
  • upto (usage post-measurement): Interfaces like chat completion where “the number of tokens used is only known at the end of the response.” maxAmountRequired is a cap (converted from the cap set by this model: cap Credits × 0.095215), and the actual settlement is based on real usage, not exceeding the cap.
For protocol details regarding these two schemes, see exact and upto billing schemes. Below, only pricing is discussed.

Chat (Chat Completion) Pricing

Chat completion is measured as upto: billed based on actual usage of prompt/completion tokens. The price per million (1M) tokens = The Credits cost of this model per 1M tokens × 0.095215, which is completely consistent with the USD unit prices displayed in the platform’s public model directory (/api/v1/models?with_pricing=true). The following table shows the actual prices (taken from the model directory, calculated at the X402 exchange rate), in USD / 1M tokens: Notes:
  • The table shows the unit price measured by token; the cost of a single request = input tokens × input unit price + output tokens × output unit price.
  • The upto cap is the maximum amount allowed to be signed for a single request for that model; it is not the actual deduction, as the vast majority of requests are far below the cap.
  • The cap only determines “the maximum that could possibly be deducted,” while the actual settlement is calculated based on token usage.

Example: Quotation and Deduction Match (exact)

Below is a real paid call initiated to serp/google using the official X402Client (Base exact). It demonstrates the consistency of the three: 402 quotation, signed amount, and the cost returned in the successful response.
The cost.amount (0.000952 USDC) returned in the response is completely consistent with the 402 quote and Credits × 0.095215. The settlement field indicates the settlement status of the payment (authorized = authorized); on-chain settlement is handled by the platform, see the exact and upto billing schemes.

upto Quote Calculation (Chat)

Chat is measured by token. The quote for a request (not the cap) is calculated using the following formula (taking gpt-4o-mini as an example):
For a request of 500 prompt + 200 completion tokens:
The client signs according to the upto cap (gpt-4o-mini is 1 Credit = 95215 atomic), which is just the maximum possible deduction; the actual quote for this request (approximately $0.0001 in the example) is far below the cap and is settled based on token usage. The on-chain settlement mechanism for upto can be found in the exact and upto billing schemes.

Other Service Prices (Fixed Price exact)

For interfaces like images, videos, music, and search, the price can be determined at the time of the request using exact. The table below shows the actual prices, taken from the online interface’s 402 maxAmountRequired for unpaid requests (querying the quote does not incur charges): Note:
  • The price for the same service varies with model, resolution, duration, and action (especially for video). The table shows the actual values under a specific set of parameters, for reference only.
  • For these fixed-price (exact) interfaces, the maxAmountRequired in the 402 response for this request is the amount due (consistent with the cost.amount in a successful response, as tested in the previous section).
  • Each price is obtained by rounding down Credits × 0.095215 to the atomic unit (see the pricing benchmark above), using the same conversion as for chat. Due to floating-point representation and rounding, some values may differ from the naive product by 1 atomic ($0.000001), and the 402 returned value shall prevail.

Order Payment Price

When using the X402 payment console to pay for orders (purchase packages / recharge Credits), the price is based on what is displayed on the order page, and the 402 amount is the final signature basis. Order payments go through the platform API and require an account token, see the Order Payment Tutorial. A real example from the order payment tutorial (purchasing 10 Credits):
Note: Pay-per-call (as mentioned in Chat / Other Services) and order payment are two different paths. Pay-per-call uniformly uses the optimal unit price of 0.095215/Credit; order payment is priced according to the package, and the difference between the creation price and the final settlement amount is based on the Order Payment Tutorial.

How to Get Prices in Real Time

Prices vary with models and parameters, please obtain them in real time using a program, do not hard-code:
  • Pay-per-call price: Make a request to the target API without PAYMENT-SIGNATURE (and without Authorization), and read the returned 402 accepts[].maxAmountRequired. This step will not incur charges. For exact interfaces, it is the final price; for upto interfaces (chat), it is the cap, settled based on usage.
  • Chat per token unit price: GET https://platform.acedata.cloud/api/v1/models?with_pricing=true&type=chat, read each model’s pricing.input_usd / pricing.output_usd (calculated according to credit_usd_rate).
  • Conversion verification: atomic = floor(Credits × 0.095215 × 1e6), USDC = atomic / 1e6 (i.e., USDC ≈ Credits × 0.095215).
Minimum request example to get prices:

Summary

  • X402 price = The cost of Credits for this call × 0.095215, which is the same price as regular Credits billing, just settled in on-chain USDC.
  • 0.095215/Credit is the platform’s optimal tier (large amount) Credits unit price; the unit price for small top-ups is higher, so X402 automatically gets the optimal unit price.
  • The exact interface (images / videos / music / search / orders) signs the amount due for this transaction; the upto interface (chat) signs the upper limit, settled based on actual usage.
  • The authoritative price is based on the maxAmountRequired returned by 402: exact is the amount due (consistent with the successful response’s cost.amount, verified); upto is the upper limit, and the successful response’s cost.amount is the actual amount settled based on usage (≤ upper limit).