You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Metered resources** (cloud compute time, storage usage, bandwidth consumption)
111
+
-**Dynamic pricing services** based on actual usage
112
112
113
113
### `exact` Scheme
114
114
115
115
The `exact` scheme is for tokens that natively support `transferWithAuthorization`. It does not require the `PaymentPermit` contract.
116
116
117
+
### `exact_gasfree` Scheme
118
+
119
+
The `exact_gasfree` scheme is a TRON-specific payment mechanism that allows users to pay with USDT/USDD **without holding TRX for gas fees**. Settlement is handled via the official GasFree Proxy through the BankOfAI facilitator endpoint.
120
+
121
+
Key characteristics:
122
+
123
+
-**Zero gas cost for buyers**: Buyers do not need to hold TRX — gas is covered by the GasFree infrastructure
124
+
-**No API keys required**: All GasFree API calls route through the BankOfAI proxy at `https://facilitator.bankofai.io/{mainnet,nile}`, so clients do not need to configure `GASFREE_API_KEY` or `GASFREE_API_SECRET`
125
+
-**TRON only**: Available on `tron:mainnet` and `tron:nile`
126
+
117
127
### How Payment Schemes Work
118
128
119
-
1.**Authorize**
129
+
1.**Authorize**
120
130
The client signs a message authorizing a **maximum amount**.
121
131
122
-
2.**Execute**
132
+
2.**Execute**
123
133
The server performs the requested task and calculates the **actual cost**.
124
134
125
-
3.**Settle**
135
+
3.**Settle**
126
136
The Facilitator submits the on-chain transaction based on the actual cost.
127
137
128
138
---
@@ -154,7 +164,7 @@ You may deploy your own Facilitator node to gain full control over payment verif
Copy file name to clipboardExpand all lines: docs/x402/faq.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,10 @@ Common pricing models include:
67
67
68
68
#### What payment schemes does x402 support?
69
69
70
-
x402 supports `exact_permit` and `exact` payment schemes. Both allow the client to authorize a **maximum payment amount**, and the server to settle the **actual cost incurred** (up to the authorized limit). This is ideal for **metered billing**, **LLM token usage**, and similar use cases.
70
+
x402 supports three payment schemes:
71
+
72
+
-**`exact_permit`** and **`exact`**: Both allow the client to authorize a **maximum payment amount**, and the server to settle the **actual cost incurred** (up to the authorized limit). This is ideal for **metered billing**, **LLM token usage**, and similar use cases.
73
+
-**`exact_gasfree`** (TRON only): Allows buyers to pay with USDT/USDD without holding TRX for gas. All GasFree API calls are routed through the BankOfAI proxy — no API keys required on the client side.
export TRON_GRID_API_KEY="your_trongrid_api_key_here"# Recommended to avoid RPC rate limits
63
+
export TRON_GRID_API_KEY="your_trongrid_api_key_here"# Recommended for production workloads
64
64
```
65
65
66
-
> 💡 **How to get a TronGrid API Key:** Register for free at [TronGrid](https://www.trongrid.io/), create an API Key, and paste it above. You can leave this blank during testnet testing, but it is required for mainnet.
66
+
> 💡 **How to get a TronGrid API Key:** Register for free at [TronGrid](https://www.trongrid.io/), create an API Key, and paste it above. When `TRON_GRID_API_KEY` is not set, mainnet RPC calls are automatically routed to a BankOfAI-operated fallback endpoint. Setting this key is recommended for production workloads to ensure optimal performance.
67
67
68
68
</TabItem>
69
69
<TabItemvalue="BSC"label="BSC">
@@ -194,7 +194,7 @@ Before deploying your agent to production, make sure to review the following:
194
194
| Agent doesn't initiate payment, errors immediately | Skill not installed correctly | Re-run the installation command in Step 2 |
195
195
|`Private key not found` or signing fails | Environment variable not set or misconfigured | Re-run Step 1, and make sure you run the agent **in the same terminal session**|
196
196
| Insufficient balance error | No test tokens in the agent wallet | Go back to Prerequisites and claim test tokens from the faucet |
197
-
| Request times out | Network issue or RPC rate limiting | Configure `TRON_GRID_API_KEY`to avoid rate limits|
197
+
| Request times out | Network issue or RPC rate limiting | Configure `TRON_GRID_API_KEY`for better performance (a fallback endpoint is used automatically when not set)|
198
198
| Agent accesses successfully but balance doesn't change | May have accessed a free endpoint | Confirm the URL path is `/protected-nile`, not another path |
# TronGrid API Key (required for mainnet, can be left blank for testnet)
399
+
# TronGrid API Key (recommended for production; when not set, a BankOfAI fallback endpoint is used automatically)
400
400
# Apply at: https://www.trongrid.io/
401
401
TRON_GRID_API_KEY=
402
402
```
@@ -545,7 +545,7 @@ Modify the `network` parameter in the `@x402_protected` decorator in `server.py`
545
545
<Tabs>
546
546
<TabItemvalue="TRON"label="TRON">
547
547
548
-
1.**Apply for a TronGrid API Key**: go to [TronGrid](https://www.trongrid.io/) to register and create an API Key, then fill it into the `TRON_GRID_API_KEY` field in `.env` (required for mainnet)
548
+
1.**Apply for a TronGrid API Key**: go to [TronGrid](https://www.trongrid.io/) to register and create an API Key, then fill it into the `TRON_GRID_API_KEY` field in `.env` (recommended for production; a BankOfAI fallback endpoint is used automatically when not set)
549
549
2.**Replace the private key**: update the private key in `.env` to the mainnet Facilitator wallet's private key
550
550
3.**Fund the fee wallet**: transfer sufficient real TRX to the Facilitator mainnet wallet (to pay Energy and Bandwidth fees)
551
551
4.**Update the network config**: change the network configuration in the Facilitator code to `NetworkConfig.TRON_MAINNET`
Copy file name to clipboardExpand all lines: docs/x402/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ description: >-
9
9
10
10
x402 is an open blockchain payment standard built on the HTTP `402 Payment Required` status code. It enables web services to charge for APIs or content through a “pay-before-response” mechanism — without relying on traditional account systems or session management.
11
11
12
-
x402 currently supports the TRON and BSC networks, with plans to expand to a broader multi-chain ecosystem in the future.
12
+
x402 currently supports the **TRON** and **BSC** networks, with plans to expand to a broader multi-chain ecosystem in the future.
13
13
14
14
**Interested in contributing to the documentation?**
15
15
Feel free to submit a PR to the [GitHub repository](https://github.com/BofAI/docs). Our only principle is to maintain neutrality — aside from essential resource links, please avoid promotional or branded content.
0 commit comments