Fluence now lets AI agents create and fund a cloud account with USDC on Base, authenticate with the same wallet, and rent CPU or GPU resources through the core API — without signup, email, or a console visit.
Cloud infrastructure has been programmable for years. Paying for it still usually requires a human to create an account, enter billing details, and manage funds through a dashboard.
Fluence is removing that bottleneck with native x402 support, bringing agentic payments to decentralized cloud compute.
What is x402?
x402 is an open payment protocol, introduced by Coinbase, that uses the HTTP 402 Payment Required status code to let software, including AI agents, pay for API access with stablecoins such as USDC. Instead of accounts, cards, and invoices, payment becomes part of an ordinary HTTP request.
How x402 works on Fluence: from wallet to compute
x402 turns the HTTP 402 Payment Required status into a payment flow that software can handle automatically.
When an agent calls the Fluence top-up endpoint, the API returns payment instructions. Its x402 client signs a USDC payment and repeats the request. Fluence then credits the corresponding amount to the account balance.
If the wallet has never used Fluence Cloud before, the first payment automatically creates an account bound to it. The agent signs in with the same wallet using Sign-In with Ethereum (SIWE) and receives access to the Fluence API.
The complete flow is:
Wallet → x402 top-up → wallet sign-in → Fluence API → CPU or GPU compute
x402 handles account funding rather than charging for every compute API call. Once the balance is funded, infrastructure usage is charged from it as resources run.
How AI agents rent GPU and CPU compute with x402
Through the API, an agent can check available infrastructure and prices, register an SSH key, launch a workload, monitor its status, add funds, and terminate resources it no longer needs.
This enables workflows such as:
- a coding agent launching an isolated environment for tests;
- an inference service adding GPU capacity as demand grows;
- a research workflow running a temporary compute-intensive job.
Payments become part of the agent’s runtime instead of a separate process handled by a person.
Traditional cloud vs. Fluence with x402
| Traditional cloud | Fluence + x402 | |
| Account creation | Signup form, email verification | Created automatically by the first payment |
| Payment method | Credit card or invoice | USDC on Base, paid over HTTP |
| Identity | Email and password | EVM wallet (Sign-In with Ethereum) |
| Who can complete it | A human in a dashboard | An AI agent or script, end to end |
Key facts: limits and billing
At launch, payments use USDC on Base mainnet. The wallet does not need ETH for gas, as the x402 facilitator submits the transfer.
- Network and token: USDC on Base mainnet
- Gas: no ETH needed
- Top-up range: $10 to $1,000 per request, in whole cents
- Conversion: 1 USDC = 1 USD of credit
- Billing: per second, charged from the account balance
- Launching a new VM: the balance must cover all resources for at least 6 hours
- Wallet type: externally owned accounts (EOA); smart-contract wallets cannot sign in
- Client: x402 v2 (v1 packages cannot read the Fluence payment challenge)
Because wallet-based accounts have no email address, agents should monitor their balance through the API and top up before it runs out.
How to get started with x402 on Fluence
An agent needs:
- An externally owned EVM wallet.
- At least 10 USDC on Base.
- An x402 v2 client.
It then calls:
POST https://api.fluence.dev/v2/x402/top-up?amountUsd=10
The client handles the 402 → sign → retry exchange. A minimal example with the x402 v2 packages (from the Fluence docs):
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
// @x402/fetch refuses to pay more than $1 per payment unless you raise the cap.
spendControls: { maxAmountPerPayment: "$10" },
});
const response = await fetchWithPayment(
"https://api.fluence.dev/v2/x402/top-up?amountUsd=10",
{ method: "POST" },
);
console.log(response.status, await response.json());
After the balance is credited, the agent signs in with the same wallet and uses the Fluence API to rent CPU or GPU compute.
Long-running agents can also create scoped API keys with limited permissions for ongoing infrastructure management.
Read the complete Fluence x402 guide for code examples and setup instructions, or explore the Fluence API reference.
FAQ
Yes. With x402 on Fluence, an AI agent with an EVM wallet can fund a cloud account with USDC, sign in with the same wallet, and launch CPU or GPU resources through the API without human involvement.
No signup or email is required. The first x402 payment from a wallet creates a Fluence account bound to that wallet.
No. The x402 facilitator submits the USDC transfer, so the wallet only needs USDC on Base.
Each top-up must be between $10 and $1,000, in whole cents. 1 USDC is credited as 1 USD.
Yes. A wallet-funded Fluence account can rent both CPU virtual machines and GPU instances through the Fluence API.
Externally owned EVM wallets controlled by a private key. Smart-contract wallets cannot sign in.
Yes. Send your API key in the X-API-KEY header with the top-up request, and the amount is credited to that account instead of a new wallet account.