Back to Home
x402 Protocol Integration

Instant Proxy Access
for AI Agents

x402 uses HTTP's 402 Payment Required status code to enable instant, permissionless proxy access. AI agents pay with USDC and receive credentials in a single request - zero registration required.

Agent-Friendly
Automated workflows
Instant Access
No registration
USDC Payments
Base & Solana
Permissionless
No KYC required
@proxies-sx/mcp-serverx402 ENABLED
MIT License
npx @proxies-sx/mcp-server
MCP Server includes 11 x402 tools for autonomous AI payments. Learn more →

Dynamic Pricing & Availability

All x402 responses include live data:

  • Available countries - Updated every 5 minutes based on device inventory
  • Country list differs by tier - Private tier may have fewer countries
  • Pricing included in response - the live per-GB rate ($4/GB, volume discounts apply)
  • Stock levels - Real device counts per country

How It Works

Payment Flow

1

Agent Request

GET /v1/x402/proxy?country=US&duration=3600&traffic=1
2

Server Response (402 Payment Required)

Status: 402
Headers:
X-PAYMENT-REQUIRED: eyJhbW91... (payment requirements)
3

Agent Signs Payment

Agent uses wallet to sign USDC payment authorization

4

Agent Retries with Payment

GET /v1/x402/proxy?country=US&duration=3600&traffic=1
Headers:
Payment-Signature: <tx_hash> (payment proof)
5

Server Verifies & Returns Credentials

Status: 200 OK
{ proxy: { http, socks5, ... }, rotationUrl, sessionId }

402 Payment Required Response

When calling /v1/x402/proxy without payment, you receive a 402 response with payment requirements.

Dynamic Countries

Updated every 5 minutes from actual inventory

Tier-Specific

Private tier may have fewer country options

AI-Compatible

Follows x402scan validation schema for AI agents

View Full 402 Response Structure
{
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact",
    "network": "base",
    "maxAmountRequired": "4000000",
    "resource": "https://api.proxies.sx/v1/x402/proxy",
    "description": "Real 4G/5G Mobile Proxy - 5 countries available...",
    "mimeType": "application/json",
    "payTo": "0xF8cD900794245fc36CBE65be9afc23CDF5103042",
    "maxTimeoutSeconds": 30,
    "asset": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "outputSchema": {
      "input": {
        "type": "http",
        "method": "GET",
        "queryParams": {
          "country": {"type": "string", "required": true, "enum": ["DE", "PL", "US", "FR", "GB"]},
          "duration": {"type": "number", "required": true, "description": "Duration in seconds (3600-2592000)"},
          "traffic": {"type": "number", "required": true, "description": "Traffic in GB (min 0.1)"},
          "tier": {"type": "string", "enum": ["shared"], "default": "shared"}
        },
        "headerFields": {
          "X-Agent-Name": {"type": "string", "required": false}
        }
      },
      "output": {
        "sessionToken": {"type": "string"},
        "proxy": {"type": "object"},
        "expiresAt": {"type": "string"}
      }
    },
    "extra": {
      "availableCountries": ["DE", "PL", "US", "FR", "GB"],
      "pricing": {
        "shared": {"portPerMonth": 0, "trafficPerGB": 4}
      },
      "limits": {
        "minDurationSeconds": 3600,
        "maxDurationSeconds": 2592000,
        "minTrafficGB": 0.1
      }
    }
  }]
}

Quick Start

Python with x402 SDK

from x402 import X402Client

# Initialize x402 client with your wallet
client = X402Client(
    private_key="0xYourPrivateKey...",
    network="base"
)

# Request a proxy - handles 402 flow automatically
response = client.get(
    "https://api.proxies.sx/v1/x402/proxy",
    params={
        "country": "US",
        "duration": 3600,  # 1 hour
        "traffic": 1,      # 1 GB
        "tier": "shared"
    }
)

# Use the proxy
proxy = response.json()
print(f"HTTP Proxy: {proxy['proxy']['http']}")
print(f"SOCKS5 Proxy: {proxy['proxy']['socks5']}")
print(f"Expires: {proxy['proxy']['expiresAt']}")

# Rotate IP when needed
import requests
requests.get(proxy['rotationUrl'])

JavaScript/TypeScript

import { createX402Client } from '@x402/evm';
import { privateKeyToAccount } from 'viem/accounts';

// Create x402 client
const account = privateKeyToAccount('0xYourPrivateKey...');
const x402Client = createX402Client({
  account,
  network: 'base',
});

// Get proxy with automatic payment
const response = await x402Client.fetch(
  'https://api.proxies.sx/v1/x402/proxy?country=US&duration=3600&traffic=1'
);

const data = await response.json();
console.log('Proxy:', data.proxy.http);
console.log('Rotation URL:', data.rotationUrl);

// Use proxy with fetch
const proxyResponse = await fetch('https://api.ipify.org', {
  agent: new HttpsProxyAgent(data.proxy.http)
});

AI Agent Integration (Daydreams)

import { createDaydream } from '@daydreams/core';
import { x402Extension } from '@daydreams/x402';

const agent = createDaydream({
  extensions: [
    x402Extension({
      privateKey: process.env.AGENT_WALLET_KEY,
      network: 'base',
    })
  ]
});

// Agent can now make x402 payments automatically
const result = await agent.run(`
  Get a US mobile proxy for 1 hour with 1GB traffic,
  then check my current IP address through it.
`);

API Endpoints

Base URL: https://api.proxies.sx/v1/x402

Public Endpoints (No Payment Required)

GET/v1/x402/pricing

Get current pricing information. Ports are free - you pay only for traffic.

Response Example
{
  "shared": {
    "tier": "shared",
    "portPriceMonthly": 0,
    "trafficPricePerGB": 4,
    "portPricePerHour": 0,
    "portPricePerDay": 0
  },
  "networks": [
    {
      "network": "base",
      "chainId": "eip155:8453",
      "enabled": true,
      "usdcAddress": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "recipientAddress": "0xF8cD900794245fc36CBE65be9afc23CDF5103042"
    },
    {
      "network": "solana",
      "chainId": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      "enabled": true,
      "usdcAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "recipientAddress": "6eUdVwsPArTxwVqEARYGCh4S2qwW2zCs7jSEDRpxydnv"
    }
  ],
  "minDurationSeconds": 3600,
  "maxDurationSeconds": 2592000,
  "minTrafficGB": 0.1
}
GET/v1/x402/calculate

Calculate cost for specific duration and traffic.

ParameterTypeRequiredDescription
tierstringNoshared or private
durationnumberYesDuration in seconds
trafficnumberYesTraffic allocation in GB
GET/v1/x402/health

Check if x402 integration is enabled and healthy.

Payment-Gated Endpoints

GET/v1/x402/proxy402 Gated

Get proxy credentials. Returns 402 if payment not provided.

ParameterTypeRequiredDescription
countrystringYesCountry code (e.g., US, DE)
durationnumberYesDuration in seconds (min: 3600)
trafficnumberYesTraffic in GB (min: 0.1)
tierstringNoshared or private
networkstringNobase or solana
citystringNoCity code or ID
carrierstringNoCarrier code or ID
Success Response (200)
{
  "proxy": {
    "http": "http://psx_abc123:xK9mP2qR@138.201.158.43:8045",
    "socks5": "socks5://psx_abc123:xK9mP2qR@138.201.158.43:5045",
    "server": "138.201.158.43",
    "httpPort": 8045,
    "socksPort": 5045,
    "username": "psx_abc123",
    "password": "xK9mP2qR",
    "expiresAt": "2024-12-31T23:59:59.000Z"
  },
  "rotationUrl": "https://api.proxies.sx/v1/rotate/tok_abc123xyz",
  "sessionId": "675abc123def456789012345",
  "portId": "675def456abc789012345678",
  "traffic": {
    "allocatedGB": 1,
    "usedGB": 0,
    "remainingGB": 1
  },
  "payment": {
    "txHash": "0x1234567890abcdef...",
    "network": "base",
    "amountUSDC": 4.00,
    "walletAddress": "0xYourWallet..."
  },
  "location": {
    "country": "United States",
    "countryCode": "US",
    "city": null,
    "carrier": null
  }
}
GET/v1/x402/session/:sessionId

Get session details by session ID.

GET/v1/x402/session/tx/:txHash

Get session details by transaction hash.

Pricing Model

Shared Tier (The Only Tier)

Port EndpointFree
Traffic$4.00/GB

Mobile proxy port - no monthly fee, no per-hour or per-day port charges

Volume Pricing

List Price$4.00/GB
At VolumeDown to $2.40/GB

Volume ladder ($4.00 / $3.60 / $3.20 / $2.80 / $2.40 per GB) on account-based plans

Duration Is Free

There is no port rent and no per-second pro-rating. Pick any duration from 1 hour to 30 days - you pay only for the traffic you allocate, at $4.00/GB.

Example: 1 hour with 1 GB costs $4.00. 30 days with 1 GB also costs $4.00. Verify with /v1/x402/calculate.

Minimum Purchase

Min Duration
1 hour (3600s)
Max Duration
30 days
Min Traffic
0.1 GB (100 MB)
Min Cost
$0.40

Wallet Addresses

B
Base Network (EVM)

0xF8cD900794245fc36CBE65be9afc23CDF5103042

USDC Contract: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

S
Solana Network

6eUdVwsPArTxwVqEARYGCh4S2qwW2zCs7jSEDRpxydnv

USDC on Solana: Native SPL Token

Rotating IP Address

Each proxy comes with a rotation URL that can be used to get a new IP without re-purchasing:

# Rotate to new IP (no authentication required)
curl https://api.proxies.sx/v1/rotate/tok_abc123xyz

# Response:
{
  "success": true,
  "message": "Port rotated successfully",
  "newDevice": {
    "country": "United States",
    "carrier": "T-Mobile"
  }
}

Rate Limits

  • Shared ports: Minimum 5 minutes between rotations
  • Private ports: Minimum 1 minute between rotations

Error Handling

Common Errors

StatusErrorDescription
402Payment RequiredNo payment or insufficient
400Invalid durationOutside 1h-30d range
400Invalid trafficBelow 0.1 GB minimum
404No devicesLocation unavailable
429Rate limitedToo many requests

Payment Verification Errors

payment_expiredSignature expired
insufficient_amountPayment too low
invalid_recipientWrong recipient
network_mismatchWrong network
already_settledTX already used

Security Considerations

Replay Prevention

Each txHash can only be used once

Payment Expiration

Requirements expire after 5 minutes

Wallet Verification

Payment wallet recorded per session

Rate Limiting

10 requests/min on payment endpoints

Amount Validation

Server verifies payment matches request

Available Countries (Live & Dynamic)

Countries are fetched dynamically from actual device inventory - the list changes as devices are added/removed or reach capacity.

Query Endpoints

GET /v1/x402/countries                    # All available countries (dedicated port)

Example Response

Live device counts shift with supply - this is a snapshot, always read the endpoint for the current list.

[
  {"code": "NL", "name": "Netherlands", "availableDevices": 29, "tier": "both"},
  {"code": "PL", "name": "Poland", "availableDevices": 26, "tier": "both"},
  {"code": "US", "name": "United States", "availableDevices": 27, "tier": "both"},
  {"code": "GE", "name": "Georgia", "availableDevices": 9, "tier": "both"},
  {"code": "FR", "name": "France", "availableDevices": 17, "tier": "both"},
  {"code": "GB", "name": "United Kingdom", "availableDevices": 15, "tier": "both"}
]

Country Availability

Device counts shift with real-time carrier supply. Always call this endpoint before targeting a country rather than hardcoding a list - stock can go to zero and come back within minutes.

Ready to Integrate x402?

Enable your AI agents to purchase and use mobile proxies instantly with USDC payments.

Support: support@proxies.sx | Swagger: proxies.sx/docs