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 - Both shared and private tier rates
  • โ€ข 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:
X-PAYMENT-SIGNATURE: eyJzaWdu... (signed payment)
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": "4100000",
    "resource": "https://api.proxies.sx/v1/x402/proxy",
    "description": "Real 4G/5G Mobile Proxy - 5 countries available...",
    "mimeType": "application/json",
    "payTo": "0xC6C3a87363D5b37d9510202015369086e25558f1",
    "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", "private"], "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": 18, "trafficPerGB": 3.5},
        "private": {"portPerMonth": 40, "trafficPerGB": 3.7}
      },
      "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 for all tiers.

Response Example
{
  "shared": {
    "portPriceMonthly": 18.00,
    "trafficPricePerGB": 3.50,
    "description": "Shared mobile proxy port"
  },
  "private": {
    "portPriceMonthly": 40.00,
    "trafficPricePerGB": 3.70,
    "description": "Private dedicated proxy port"
  },
  "networks": ["base", "solana"],
  "minimums": {
    "durationSeconds": 3600,
    "trafficGB": 0.1
  },
  "currency": "USDC"
}
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@proxy.proxies.sx:8045",
    "socks5": "socks5://psx_abc123:xK9mP2qR@proxy.proxies.sx:5045",
    "server": "proxy.proxies.sx",
    "httpPort": 8045,
    "socksPort": 5045,
    "username": "psx_abc123",
    "password": "xK9mP2qR",
    "expiresAt": "2024-12-31T23:59:59.000Z"
  },
  "rotationUrl": "https://api.proxies.sx/rotate/tok_abc123xyz",
  "sessionId": "675abc123def456789012345",
  "portId": "675def456abc789012345678",
  "traffic": {
    "allocatedGB": 1,
    "usedGB": 0,
    "remainingGB": 1
  },
  "payment": {
    "txHash": "0x1234567890abcdef...",
    "network": "base",
    "amountUSDC": 18.10,
    "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

Port Endpoint$18/month
Traffic$3.50/GB

Shared mobile proxy port

Private Tier

Port Endpoint$40/month
Traffic$3.70/GB

Exclusive device access

Pro-Rated Duration

Prices are calculated per-second based on monthly rates:

DurationShared PortPrivate Port
1 hour$0.025$0.055
1 day$0.60$1.33
1 week$4.15$9.23
1 month$18.00$40.00

Minimum Purchase

Min Duration
1 hour (3600s)
Min Traffic
0.1 GB (100 MB)
Min Shared
~$0.375
Min Private
~$0.425

Wallet Addresses

B
Base Network (EVM)

0xC6C3a87363D5b37d9510202015369086e25558f1

USDC Contract: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

S
Solana Network

6qJVQ61ygwjuB7DK94ccrAcxgiQkc2tbbWeNCr3FT2HY

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/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
GET /v1/x402/countries?tier=shared        # Shared tier only
GET /v1/x402/countries?tier=private       # Private tier only

Example Response

[
  {"code": "US", "name": "United States", "availableDevices": 88, "tier": "both"},
  {"code": "DE", "name": "Germany", "availableDevices": 27, "tier": "both"},
  {"code": "GB", "name": "United Kingdom", "availableDevices": 22, "tier": "shared"},
  {"code": "PL", "name": "Poland", "availableDevices": 22, "tier": "both"},
  {"code": "FR", "name": "France", "availableDevices": 18, "tier": "both"}
]

Tier Availability

Private tier may have fewer countries than shared. For example, GB may only be available for shared tier. Always check the tier field in the response to confirm availability.

Ready to Integrate x402?

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

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