Skip to main content
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., 95215 atomic USDC, with USDC having 6 decimal places)
That is:
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

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: 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 with cost.amount in 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.” maxAmountRequired is 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: Notes:
  • The table shows token-metered unit prices; the cost of one request = input tokens × input unit price + output tokens × output unit price.
  • The upto limit 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.
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):
A request with 500 prompt + 200 completion tokens:
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): 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, the maxAmountRequired in the 402 response for that request is the amount payable for that request (consistent with cost.amount in the successful response, as verified in the previous section).
  • Each price is obtained by rounding down Credits × 0.095215 to 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):
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 without Authorization), then read the returned 402 accepts[].maxAmountRequired. This step does not incur charges. For exact APIs, it is the final price; for upto APIs (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 read pricing.input_usd / pricing.output_usd for each model (already calculated using credit_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:

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 exact APIs (image / video / music / search / order), the signed amount is the amount payable for that call; for upto APIs (chat), the signed amount is the upper limit, and settlement is based on actual usage.
  • The authoritative price is based on the maxAmountRequired returned by 402: for exact, it is the payable amount (consistent with cost.amount in the successful response, verified through testing); for upto, it is the upper limit, and cost.amount in the successful response is the actual amount settled based on usage (≤ upper limit).