{
  "openapi": "3.1.0",
  "info": {
    "title": "Zyvrox Protocol API",
    "description": "The Zyvrox Protocol: AI-native marketplace for human and agent commerce. Compatible with OpenAI function calling, Claude MCP, OpenClaw, NanoClaw, LangChain.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://gatewaypay.online/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Agent API key from /agent/register"
      }
    }
  },
  "paths": {
    "/agent/register": {
      "post": {
        "operationId": "registerAgent",
        "summary": "Register agent account",
        "description": "Create an account and get an API key.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "username",
                  "email",
                  "password"
                ],
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API key returned"
          }
        }
      }
    },
    "/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "Browse marketplace",
        "description": "List all available digital assets.",
        "security": [],
        "responses": {
          "200": {
            "description": "Product list"
          }
        }
      }
    },
    "/proxy/info": {
      "get": {
        "operationId": "proxyInfo",
        "summary": "SOCKS5 proxy pool info",
        "description": "Pool size, countries, pricing. $0.001 per proxy. No auth.",
        "security": [],
        "responses": {
          "200": {
            "description": "Pool stats and pricing"
          }
        }
      }
    },
    "/proxy/countries": {
      "get": {
        "operationId": "proxyCountries",
        "summary": "Available proxy countries",
        "security": [],
        "responses": {
          "200": {
            "description": "Country list with counts"
          }
        }
      }
    },
    "/proxy/list": {
      "get": {
        "operationId": "proxyList",
        "summary": "Fetch SOCKS5 proxies",
        "description": "Returns proxies. Charged $0.001 each from wallet.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100
            }
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string",
              "example": "US"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Proxy list with billing info"
          },
          "402": {
            "description": "Insufficient wallet balance"
          }
        }
      }
    },
    "/proxy/my-key": {
      "get": {
        "operationId": "proxyMyKey",
        "summary": "Get SOCKS5 reveal key",
        "description": "Personal key for the proxy portal at apps.gatewaypay.online/socks5",
        "responses": {
          "200": {
            "description": "Reveal key"
          }
        }
      }
    },
    "/email/validate/{email}": {
      "get": {
        "operationId": "validateEmail",
        "summary": "Validate email address",
        "parameters": [
          {
            "name": "email",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validation result"
          }
        }
      }
    },
    "/wallet": {
      "get": {
        "operationId": "getWallet",
        "summary": "Get wallet balance",
        "responses": {
          "200": {
            "description": "Balance info"
          }
        }
      }
    },
    "/orders": {
      "post": {
        "operationId": "purchaseProduct",
        "summary": "Purchase a digital asset",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "product_id"
                ],
                "properties": {
                  "product_id": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Order created"
          }
        }
      }
    },
    "/vault/{order_id}": {
      "get": {
        "operationId": "getVaultItem",
        "summary": "Retrieve purchased asset",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Asset content"
          }
        }
      }
    },
    "/algo/info": {
      "get": {
        "operationId": "algoInfo",
        "summary": "ALGO price + platform wallet",
        "security": [],
        "responses": {
          "200": {
            "description": "Algorand info"
          }
        }
      }
    },
    "/stripe/topup": {
      "post": {
        "operationId": "stripeTopup",
        "summary": "Top up wallet via Stripe",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "amount"
                ],
                "properties": {
                  "amount": {
                    "type": "number"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Checkout URL"
          }
        }
      }
    }
  }
}