# x402 Crypto Agent Gateway: B2B Data & MCP on Base Mainnet (`unlimitedbands/x402-crypto-agent-gateway`) Actor

Production-grade x402 HTTP & MCP micropayment gateway for autonomous AI agents. Accepts USDC on Base (8453) directly to 0xef5766253e2d92e530e301ac22dcb8de78e89c55 for B2B enrichment, hiring intent leads, WCAG audits, SaaS review mining, and Swiss gov triggers.

- **URL**: https://apify.com/unlimitedbands/x402-crypto-agent-gateway.md
- **Developed by:** [Archie Campbell](https://apify.com/unlimitedbands) (community)
- **Categories:** Developer tools, AI, Business
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## x402 Crypto Agent Gateway - Base USDC B2B Data Hub

A production-grade **x402 Protocol Payment Gateway & Standby Web Server** for autonomous AI agents, MCP clients, and LLM swarms.

Allows AI agents to call all 5 B2B data scrapers and pay per call directly in **USDC on Base Mainnet** (`eip155:8453`) to:

```
0xef5766253e2d92e530e301ac22dcb8de78e89c55
```

***

### 1. Supported Endpoints & Base USDC Pricing

| Endpoint | B2B Scraper Tool | Price (USD) | Atomic Units (USDC 6 Decimals) | Description |
| :--- | :--- | :--- | :--- | :--- |
| `GET/POST /v1/enrich` | `b2b-domain-contact-icp-enricher` | **$0.0050** | `5000` | Verified emails, phones, social links, 42 tech stacks, DNS security & ICP score |
| `GET/POST /v1/intent-jobs` | `tech-stack-intent-job-scraper` | **$0.0060** | `6000` | Hiring intent leads across 58+ tech stacks with icebreakers & resolved domains |
| `GET/POST /v1/wcag-audit` | `eaa-wcag-compliance-lead-auditor` | **$0.0100** | `10000` | EAA/WCAG 2.2 accessibility audit with ready CSS/HTML remediation code |
| `GET/POST /v1/reviews` | `saas-marketplace-review-miner` | **$0.0040** | `4000` | 1-to-3 star competitor reviews mining churn intent and micro-SaaS gaps |
| `GET/POST /v1/swiss-leads` | `swiss-eu-gov-shab-trigger-leads` | **$0.0100** | `10000` | Swiss commercial register incorporations (HR01) and municipal building permits |
| `POST /mcp` | Model Context Protocol | *Varies* | *Varies* | Full JSON-RPC 2.0 MCP stream supporting `tools/list` and `tools/call` |
| `GET /.well-known/x402.json` | Discovery Manifest | **Free** | `0` | Machine-readable x402 service catalog and pricing |

***

### 2. Payment Specifications (Base Mainnet)

- **Network:** Base Mainnet (`eip155:8453` / Chain ID `8453`)
- **Asset Contract:** `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` (Official Base USD Coin - 6 decimals)
- **Payee Wallet:** `0xef5766253e2d92e530e301ac22dcb8de78e89c55`
- **Replay Protection:** Built-in cryptographic transaction receipt verification and cache prevents double-spending.

***

### 3. How the x402 Protocol Flow Works

```mermaid
sequenceDiagram
    autonumber
    actor Agent as Autonomous AI Agent
    participant GW as x402 Gateway (Apify Standby)
    participant Base as Base Mainnet (8453)
    participant Actor as Scraper Pipeline

    Agent->>GW: POST /v1/enrich {"domain": "stripe.com"}
    GW-->>Agent: HTTP 402 Payment Required<br/>PAYMENT-REQUIRED: (Base64 Specs)<br/>payTo: 0xef57662... Amount: 5000 USDC units
    Agent->>Base: Transfer 0.005 USDC to 0xef57662...
    Base-->>Agent: Tx Confirmed (0xabc123...)
    Agent->>GW: POST /v1/enrich<br/>X-PAYMENT: {"txHash": "0xabc123..."}
    GW->>Base: Verify eth_getTransactionReceipt(0xabc123...)
    Base-->>GW: Status 0x1, Transfer(0.005 USDC to 0xef57662...)
    GW->>Actor: Execute Enrichment Pipeline
    Actor-->>GW: Verified Contact & Tech Stack JSON
    GW-->>Agent: HTTP 200 OK<br/>X-PAYMENT-RESPONSE: (Settlement Receipt)<br/>Enriched B2B Payload
```

***

### 4. Quickstart Examples

#### A. Testing the 402 Challenge (Unpaid)

```bash
curl -i https://unlimitedbands--x402-crypto-agent-gateway.apify.actor/v1/enrich \
  -H "Content-Type: application/json" \
  -d '{"domain": "stripe.com"}'
```

Response:

```http
HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: eyJ4NDAyVmVyc2lvbiI6Miw...
Content-Type: application/json

{
  "x402Version": 2,
  "error": "Payment Required",
  "accepts": [
    {
      "network": "eip155:8453",
      "amount": "5000",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "payTo": "0xef5766253e2d92e530e301ac22dcb8de78e89c55"
    }
  ]
}
```

#### B. Executing with Payment (On-Chain Base Tx Hash)

```bash
curl -X POST https://unlimitedbands--x402-crypto-agent-gateway.apify.actor/v1/enrich \
  -H "Content-Type: application/json" \
  -H "X-PAYMENT: {\"txHash\": \"0xYourBaseTxHash...\"}" \
  -d '{"domain": "stripe.com"}'
```

#### C. Automated Testing / Sandbox Simulation Mode

For automated integration tests without spending live Base gas:

```bash
curl -X POST http://localhost:4321/v1/enrich \
  -H "Content-Type: application/json" \
  -H 'X-PAYMENT: {"test": true, "simulation": "allow"}' \
  -d '{"domain": "stripe.com"}'
```

***

### 5. Model Context Protocol (MCP) Integration

Add to your `claude_desktop_config.json` or Cursor MCP settings:

```json
{
  "mcpServers": {
    "x402-b2b-gateway": {
      "type": "http",
      "url": "https://unlimitedbands--x402-crypto-agent-gateway.apify.actor/mcp"
    }
  }
}
```

# Actor input Schema

## `mode` (type: `string`):

Choose 'standby' to keep the x402 HTTP & MCP web server running for AI agents, or 'direct_query' to test a specific tool immediately.

## `tool` (type: `string`):

Select the B2B scraper tool to test.

## `query` (type: `string`):

Domain (e.g. stripe.com), company URL, or keyword for direct query testing.

## `port` (type: `integer`):

HTTP port to bind the x402 server to (defaults to Apify container port 4321).

## `walletAddress` (type: `string`):

The Base (EVM) wallet that receives USDC payments directly from AI agents.

## Actor input object example

```json
{
  "mode": "standby",
  "tool": "enrich",
  "query": "stripe.com",
  "port": 4321,
  "walletAddress": "0xef5766253e2d92e530e301ac22dcb8de78e89c55"
}
```

# Actor output Schema

## `settlements` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("unlimitedbands/x402-crypto-agent-gateway").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("unlimitedbands/x402-crypto-agent-gateway").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call unlimitedbands/x402-crypto-agent-gateway --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,unlimitedbands/x402-crypto-agent-gateway"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/siLiw7r0eP0dWQprZ/builds/sIWtUOd2Vh1b5HPxw/openapi.json
