> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Web3 Subscribe Schema

> Start Build or Pro access via x402 USDC payment JSON Schema contract. Includes route metadata, schemas, examples, and implementation notes.

Source OpenAPI: 0xArchive API 1.5.0; 140 paths; 119 component schemas.

x402-protected endpoint for purchasing 30-day Build or Pro access with USDC on Base. **Flow:** 1. POST with `&#123; "tier": "build" &#125;` (no payment header) → Server returns 402 with payment details (amount, pay\_to address, network) 2. Sign an EIP-712 `TransferWithAuthorization` (EIP-3009) on USDC Base for the specified amount 3. Build x402 v2 payment payload, base64-encode it, and retry with `payment-signature` header 4. Server verifies payment via facilitator → grants access → returns API key No API key required. Payment IS the authentication.

## Route Metadata

| Field                | Value                |
| -------------------- | -------------------- |
| Method               | `POST`               |
| Path                 | `/v1/web3/subscribe` |
| operationId          | `web3Subscribe`      |
| Tag                  | Web3 Authentication  |
| Family               | Web3 Auth            |
| Deprecated or legacy | no                   |

## Request Parameters

### Header Parameters

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "web3Subscribe header parameters",
  "type": "object",
  "properties": {
    "payment-signature": {
      "description": "Base64-encoded x402 v2 payment payload containing the EIP-3009 signed USDC transfer authorization. Omit on first request to receive payment details.",
      "type": "string",
      "x-parameter-location": "header"
    }
  }
}
```

## Request Body

### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "web3Subscribe request body",
  "type": "object",
  "required": [
    "tier"
  ],
  "properties": {
    "tier": {
      "description": "Subscription tier to purchase",
      "type": "string",
      "enum": [
        "build",
        "pro"
      ],
      "example": "build"
    }
  }
}
```

## Response Contracts

### Status 200

Subscription created successfully (returned when valid payment-signature header is provided)

#### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "web3Subscribe response 200",
  "type": "object",
  "properties": {
    "api_key": {
      "description": "The generated API key for the new subscription",
      "type": "string",
      "example": "0xa_..."
    },
    "expires_at": {
      "description": "Subscription expiration date (30 days from purchase)",
      "type": "string",
      "format": "date-time"
    },
    "tier": {
      "description": "The subscription tier activated",
      "type": "string",
      "example": "build"
    },
    "tx_hash": {
      "description": "On-chain transaction hash for the USDC transfer (if settled)",
      "type": "string",
      "nullable": true
    },
    "wallet_address": {
      "description": "The wallet address associated with the subscription",
      "type": "string"
    }
  }
}
```

### Status 402

Payment required. Response includes payment details: amount (micro-USDC), pay\_to address, and network. Sign and retry with payment-signature header.

#### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "web3Subscribe response 402",
  "type": "object",
  "properties": {
    "payment": {
      "type": "object",
      "properties": {
        "amount": {
          "description": "Amount in micro-USDC (6 decimals)",
          "type": "string",
          "example": "49000000"
        },
        "network": {
          "description": "Blockchain network",
          "type": "string",
          "example": "base"
        },
        "pay_to": {
          "description": "Treasury address to send USDC to",
          "type": "string",
          "example": "0x..."
        }
      }
    }
  }
}
```

### Status 429

Rate limit exceeded

#### application/json

```json theme={"theme":"github-dark"}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "web3Subscribe response 429",
  "description": "Error response",
  "type": "object",
  "properties": {
    "code": {
      "description": "HTTP status code",
      "type": "integer"
    },
    "error": {
      "description": "Error message",
      "type": "string"
    }
  }
}
```

##### OpenAPI example

```json theme={"theme":"github-dark"}
{
  "code": 429,
  "error": "Rate limit exceeded"
}
```
