Documentation

Complete guide to using the QuantumShield Security API with x402 micropayments.

1. Overview

QuantumShield API provides real-time security intelligence for blockchain tokens, wallets, and smart contracts. Built for AI agents and developers who need instant risk assessment without subscriptions or API keys.

Base URL
https://quantumshield-api.vercel.app
Payment Network
Base (Chain ID: 8453)
Payment Asset
USDC

2. How x402 Payments Work

x402 is an open payment protocol that lets you pay per API request using stablecoins. No API keys, no subscriptions—just pay and use.

1
Make a Request
Call any endpoint without authentication
2
Receive 402 Response
Get payment details including price, network, and facilitator URL
3
Pay via Facilitator
Send USDC payment through x402.org facilitator on Base
4
Retry with Proof
Resend your request with X-Payment header containing payment proof
5
Get Data
Receive the security analysis data
# Example 402 Response
{
  "error": "Payment Required",
  "message": "This endpoint requires $0.002 USDC payment",
  "paymentDetails": {
    "x402Version": 1,
    "accepts": [{
      "scheme": "exact",
      "network": "base",
      "maxAmountRequired": "0.002",
      "asset": "USDC",
      "payTo": "0x7d9ea6549d5b86ef07b9fa2f1cbac52fc523df65"
    }],
    "facilitatorUrl": "https://x402.org/facilitator"
  }
}

3. API Endpoints

Token Security

$0.002
GET /api/token/security?address=<contract>&chain=<chain>
Parameters
  • address - Token contract address (required)
  • chain - Network: base, eth, bsc, polygon, arbitrum (default: base)
Returns
  • Risk score (0-100)
  • Risk level (LOW/MEDIUM/HIGH)
  • Honeypot, tax, ownership flags

Contract Audit

$0.003
GET /api/contract/audit?address=<contract>&chain=<chain>
Parameters
  • address - Contract address (required)
  • chain - Network (default: base)
Returns
  • Security score & grade (A-F)
  • Audit flags (proxy, selfdestruct, etc.)
  • Ownership & trading risks

Liquidity Check

$0.002
GET /api/liquidity/check?address=<contract>&chain=<chain>
Parameters
  • address - Token address (required)
  • chain - Network (default: base)
Returns
  • Rug pull risk score
  • LP lock percentage
  • Top LP holders

Wallet Risk

$0.002
GET /api/wallet/risk?address=<wallet>&chain=<chain_id>
Parameters
  • address - Wallet address (required)
  • chain - Chain ID (default: 1)
Returns
  • Risk score & level
  • Phishing, scam, blacklist flags
  • Money laundering indicators

Honeypot Check

$0.001
GET /api/honeypot/check?address=<contract>&chain=<chain>
Parameters
  • address - Token address (required)
  • chain - Network (default: base)
Returns
  • Honeypot status (true/false)
  • Buy/sell tax percentages
  • Trading restriction flags

Pair Analysis

$0.002
GET /api/pair/analysis?address=<contract>&chain=<chain>
Parameters
  • address - Token address (required)
  • chain - Network (default: base)
Returns
  • Safety score & grade
  • DEX pairs & liquidity
  • Trading conditions

Whale Activity

$0.002
GET /api/whale/activity?address=<contract>&chain=<chain>
Parameters
  • address - Token address (required)
  • chain - Network (default: base)
Returns
  • Concentration risk score
  • Top holders list
  • Whale wallet analysis

4. Code Examples

cURL

# Step 1: Make initial request (will return 402)
curl https://quantumshield-api.vercel.app/api/token/security?address=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&chain=base

# Step 2: After payment, retry with X-Payment header
curl -H "X-Payment: <payment-proof>" \
  https://quantumshield-api.vercel.app/api/token/security?address=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&chain=base

JavaScript

const checkToken = async (address, chain = 'base') => {
  const url = `https://quantumshield-api.vercel.app/api/token/security?address=${address}&chain=${chain}`;

  // Initial request - will return 402
  const response = await fetch(url);

  if (response.status === 402) {
    const { paymentDetails } = await response.json();
    console.log('Payment required:', paymentDetails);

    // TODO: Process payment via x402 facilitator
    // const paymentProof = await processPayment(paymentDetails);

    // Retry with payment proof
    // const data = await fetch(url, {
    //   headers: { 'X-Payment': paymentProof }
    // });
  }

  return response.json();
};

// Usage
checkToken('0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', 'base');

Python

import requests

def check_token(address: str, chain: str = "base"):
    url = f"https://quantumshield-api.vercel.app/api/token/security"
    params = {"address": address, "chain": chain}

    # Initial request - will return 402
    response = requests.get(url, params=params)

    if response.status_code == 402:
        payment_details = response.json()["paymentDetails"]
        print(f"Payment required: {payment_details}")

        # TODO: Process payment via x402 facilitator
        # payment_proof = process_payment(payment_details)

        # Retry with payment proof
        # headers = {"X-Payment": payment_proof}
        # response = requests.get(url, params=params, headers=headers)

    return response.json()

# Usage
result = check_token("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "base")
print(result)

5. FAQ

What is x402?

x402 is an open payment protocol that enables pay-per-request API calls using cryptocurrency. It's based on HTTP 402 'Payment Required' status code, finally giving it a purpose after decades of being unused.

Which chains are supported?

We support Base, Ethereum, BSC, Polygon, and Arbitrum for token analysis. Payments are processed on Base using USDC.

How do I get USDC on Base?

You can bridge USDC from other chains using the official Base Bridge, or purchase directly through exchanges that support Base network.

Do I need an API key?

No! That's the beauty of x402. You pay per request with no signup, no API keys, and no subscriptions required.

How fast are the responses?

Once payment is verified, responses typically return within 1-2 seconds. The security data is fetched from GoPlus Security API in real-time.

Can AI agents use this API?

Yes! This API is specifically designed for AI agents. x402 enables autonomous agents to pay for services without human intervention.

Where can I learn more about x402?

Visit x402.org for the protocol specification, or check out x402scan.com to see live x402 transactions and services.

Need Help?

Check out our GitHub or reach out for support