{
  "openapi": "3.1.0",
  "info": {
    "title": "Sycamore Agent Payment Test",
    "version": "1.0.0",
    "description": "Pay-per-call diagnostic endpoint for AI agents using the x402 payment protocol. Request /api/verify, receive HTTP 402 with payment requirements, pay $10 USDC (Base, gasless EIP-3009), and receive an Ed25519-signed diagnostic report card verifying your full agentic payment flow. No signup, no API keys. The 402 response's accepts[] array is the source of truth for current price, network, and pay-to address.",
    "contact": { "name": "Sycamore", "url": "https://sycamore-api.com" },
    "termsOfService": "https://test.sycamore-api.com/privacy"
  },
  "servers": [{ "url": "https://test.sycamore-api.com" }],
  "paths": {
    "/api/verify": {
      "get": {
        "operationId": "verifyAgentPayment",
        "summary": "Pay $10, receive a signed diagnostic report card",
        "description": "x402-gated. First call returns 402 with payment requirements (v2 PAYMENT-REQUIRED header and v1 JSON body). Retry with a valid X-PAYMENT / PAYMENT-SIGNATURE header to receive the report. Settlement transaction hash is returned in the base64 X-PAYMENT-RESPONSE response header.",
        "parameters": [
          {
            "name": "receipt_email",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "format": "email" },
            "description": "Optional. If provided, an emailed receipt with the settlement transaction hash is sent to this address."
          }
        ],
        "responses": {
          "402": {
            "description": "Payment required. Body carries x402 v1 PaymentRequired (x402Version, accepts[]); PAYMENT-REQUIRED header carries the v2 equivalent."
          },
          "200": {
            "description": "Signed diagnostic report card.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": { "type": "string" },
                    "receipt_id": { "type": "string" },
                    "summary": { "type": "string" },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "step": { "type": "string" },
                          "status": { "type": "string" },
                          "detail": { "type": "string" }
                        }
                      }
                    },
                    "latency": { "type": "object" },
                    "origin": { "type": "object" },
                    "payment": { "type": "object" },
                    "headers_echo": { "type": "object" },
                    "signature": {
                      "type": "object",
                      "properties": {
                        "algorithm": { "type": "string", "const": "ed25519" },
                        "canonicalization": { "type": "string" },
                        "signature": { "type": "string" }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "verifyAgentPaymentPost",
        "summary": "POST variant of the paid diagnostic endpoint",
        "responses": { "402": { "description": "Payment required." }, "200": { "description": "Signed diagnostic report card." } }
      }
    },
    "/healthz": {
      "get": { "operationId": "health", "summary": "Liveness (free)", "responses": { "200": { "description": "OK" } } }
    },
    "/pubkey": {
      "get": { "operationId": "receiptPublicKey", "summary": "Ed25519 public key for receipt verification (free)", "responses": { "200": { "description": "PEM public key" } } }
    }
  }
}
