{
  "openapi": "3.1.0",
  "info": {
    "title": "Proxy4G Agent API",
    "version": "1.0.0",
    "description": "Machine API for autonomous AI agents to fund a balance and buy no-KYC 4G/LTE mobile proxies with crypto. Agents authenticate with a Bearer token (POST ?action=account) and pay with x402 (USDC on Base): POST ?action=topup with header 'X-Payment-Mode: x402' returns HTTP 402 + an x402 'accepts' block; sign the EIP-3009 USDC authorization and re-send with the 'X-PAYMENT' header.",
    "contact": { "url": "https://proxy4g.co" }
  },
  "servers": [{ "url": "https://proxy4g.co" }],
  "paths": {
    "/agent-api.php?action=account": { "post": { "operationId": "createAccount", "summary": "Create an agent account, returns a Bearer token", "responses": { "201": { "description": "{ account_token }" } } } },
    "/agent-api.php?action=topup": { "post": { "operationId": "topup",
      "summary": "x402 balance top-up. 1st call -> HTTP 402 accepts; signed retry (X-PAYMENT) settles.",
      "description": "Authorization: Bearer <account_token>. Send 'X-Payment-Mode: x402'. The 402 body has x402Version + accepts[] (scheme exact, USDC on Base). Sign the EIP-3009 authorization and re-send with header 'X-PAYMENT'.",
      "requestBody": { "required": true, "content": { "application/json": { "example": { "amount": 25 } } } },
      "responses": { "200": { "description": "Settled", "headers": { "X-PAYMENT-RESPONSE": { "schema": { "type": "string" } } } }, "402": { "description": "x402 Payment Required — body has accepts[]" }, "401": { "description": "Bearer token required" } } } },
    "/agent-api.php?action=status": { "get": { "operationId": "topupStatus", "summary": "Top-up status",
      "parameters": [{ "name": "id", "in": "query", "required": true, "schema": { "type": "integer" } }],
      "responses": { "200": { "description": "Status" }, "404": { "description": "Not found" } } } }
  },
  "components": { "securitySchemes": { "bearer": { "type": "http", "scheme": "bearer" } } },
  "x-x402": { "supported": true, "mode": "exact", "network": "base", "asset": "USDC", "model": "balance-topup" },
  "x-discovery": "https://proxy4g.co/.well-known/agent.json"
}
