⚡ x402 Agentic Payments

AI agents pay per-request with USDC on Base chainLIVE

No accounts • No API keys • Zero friction • x402.org protocol

Overview

DCDN Cloud supports the x402 protocol — an open standard for internet-native payments built on HTTP 402. AI agents can access GPU inference, browser APIs, and other services by paying per-request with USDC stablecoins on Base (Coinbase L2).

🤖
For AI Agents

No signup, no API key management. Just pay and use.

Instant Settlement

USDC on Base — sub-second finality, ~$0.001 gas.

🔒
Trust-Minimized

Verified by independent facilitator. No custody risk.

🌐
Open Standard

Built on HTTP 402. Works with any x402 client SDK.

How It Works

1
Agent sends HTTP request

Your agent calls a DCDN paid endpoint (e.g., POST /api/v1/x402/inference).

2
DCDN returns 402 Payment Required

The response includes payment requirements: price, USDC address, network, and facilitator URL.

3
Agent signs USDC payment

Using the x402 SDK, your agent signs a USDC transfer on Base chain.

4
Agent retries with payment header

The agent resends the request with a PAYMENT-SIGNATURE header containing the signed payment.

5
DCDN verifies and responds

DCDN verifies the payment via the facilitator, then processes the request and returns the result.

API Endpoints

Paid Endpoints (402)

MethodEndpointPriceDescription
POST/api/v1/x402/inferencesh.0005GPU inference — text generation, chat, completion
POST/api/v1/x402/browsersh.002Browser API — screenshot, scrape, navigate

Free Endpoints

MethodEndpointDescription
GET/api/v1/x402/infoProtocol info, configuration
GET/api/v1/x402/pricingDetailed pricing for all endpoints
GET/api/v1/x402/nodesList available GPU nodes
GET/api/v1/x402/modelsList available AI models
GET/api/v1/x402/statsPayment statistics

Quick Start (Python)

1. Install the x402 SDK

pip install "x402[httpx,evm]"

2. Run Inference

import asyncio
from x402 import x402Client
from x402.mechanisms.evm.exact import ExactEvmScheme
from eth_account import Account

# Your wallet (needs USDC on Base)
wallet = Account.from_key("YOUR_PRIVATE_KEY")
signer = wallet  # eth_account signer

# Setup x402 client
client = x402Client()
client.register("eip155:*", ExactEvmScheme(signer=signer))

async def run_inference():
    import httpx

    url = "https://dcdncloud.com/api/v1/x402/inference"
    payload = {
        "messages": [{"role": "user", "content": "What is DCDN Cloud?"}],
        "max_tokens": 256
    }

    async with httpx.AsyncClient() as http:
        # Step 1: Get 402 response
        resp = await http.post(url, json=payload)

        if resp.status_code == 402:
            # Step 2: Create payment from 402 requirements
            payment = await client.create_payment_payload(resp)

            # Step 3: Retry with payment
            resp = await http.post(url, json=payload, headers={
                "PAYMENT-SIGNATURE": payment
            })

        print(resp.json())

asyncio.run(run_inference())

3. Browser API

# Same pattern — just change the endpoint and payload
url = "https://dcdncloud.com/api/v1/x402/browser"
payload = {"url": "https://example.com", "action": "screenshot"}

Configuration

NetworkBase (eip155:8453)
CurrencyUSDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
Pay-to Address0xb839eB6a2611Fc668D9597B16e6AAdb83dC3Ad72
Facilitatorhttps://x402.org/facilitator
Protocol Version2.0

Response Format

402 Payment Required

HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: <base64-encoded requirements>
Content-Type: application/json

{
  "error": "Payment Required",
  "protocol": "x402",
  "version": "2.0",
  "price_usd": "0.0005",
  "network": "eip155:8453",
  "asset": "USDC",
  "pay_to": "0xb839eB6a2611Fc668D9597B16e6AAdb83dC3Ad72",
  "facilitator": "https://x402.org/facilitator",
  "requirements": [{...}]
}

Success (after payment)

HTTP/1.1 200 OK

{
  "status": "success",
  "payment": {
    "protocol": "x402",
    "amount_usd": "0.0005",
    "network": "eip155:8453",
    "verified": true
  },
  "node": {"id": "...", "name": "gpu-eu-01", "gpu": "NVIDIA RTX 4090"},
  "result": {
    "choices": [{"message": {"content": "..."}}],
    "usage": {"total_tokens": 128}
  }
}

FAQ

How much USDC do I need?

A single inference call costs $0.0005. Even $1 of USDC gives you 2,000 inference calls. You also need ~$0.001 in ETH on Base for gas.

Which wallets work?

Any EVM wallet with USDC on Base chain. The x402 SDK handles signing automatically — you just provide a private key or signer.

Is there an alternative to x402?

Yes! DCDN also offers traditional API access with account registration, API keys, and credit-based billing via the dashboard.

What if the facilitator is down?

You can use any x402-compatible facilitator, or run your own. The protocol is decentralized and facilitator-agnostic.

x402.org · GitHub · DCDN Dashboard
© 2026 DCDN Cloud