{
  "openapi": "3.1.0",
  "info": {
    "title": "RBR — Profit Recipe API",
    "version": "1.0.0",
    "description": "A single MPP-paywalled endpoint that returns a markdown Profit Recipe (arbitrage opportunity)."
  },
  "servers": [
    {
      "url": "https://rbr-recipe.vercel.app"
    }
  ],
  "paths": {
    "/api/recipe": {
      "get": {
        "summary": "Buy and download the Profit Recipe",
        "description": "First request returns 402 with a WWW-Authenticate Payment challenge. Sign with an MPP-compatible client and retry. Second request returns the markdown recipe.",
        "x-mpp-payment": {
          "protocol": "mpp",
          "protocolVersion": "1.0",
          "method": "tempo",
          "intent": "charge",
          "network": "mainnet",
          "chainId": 4217,
          "currency": "0x20c000000000000000000000b9537d11c60e8b50",
          "currencyName": "USDC.e",
          "decimals": 6,
          "amount": "0.01"
        },
        "responses": {
          "200": {
            "description": "Recipe markdown",
            "headers": {
              "Payment-Receipt": {
                "description": "Receipt token confirming on-chain settlement",
                "schema": {
                  "type": "string"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "402": {
            "description": "Payment Required — sign the WWW-Authenticate challenge and retry",
            "headers": {
              "WWW-Authenticate": {
                "description": "Payment challenge in the form: Payment id=\"...\", realm=\"...\", method=\"tempo\", intent=\"charge\", request=\"<base64>\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "challengeId": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "options": {
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    }
  }
}