{
  "openapi": "3.1.0",
  "info": {
    "title": "Stripe Climate Contribution API",
    "version": "1.0.0",
    "description": "Contribute to Stripe Climate to fund permanent carbon removal technologies. Stripe contributes 100% of funds towards carbon removal projects, minus any third-party fees.",
    "guidance": "Use POST /api/contribute to make a carbon removal contribution. Send a JSON body with an 'amount' field (integer, in cents, between 1 and 10000). The endpoint requires payment via MPP (USDC on Tempo eip155:42431) or x402 (USDC on Base eip155:8453). The payment amount equals the contribution amount in cents. On success, you receive a contribution_id and a human-readable impact description."
  },
  "x-discovery": {
    "ownershipProofs": []
  },
  "paths": {
    "/api/contribute": {
      "post": {
        "operationId": "contribute",
        "summary": "Contribute - Fund permanent carbon removal via Stripe Climate",
        "tags": ["Carbon Removal"],
        "x-payment-info": {
          "pricingMode": "range",
          "minPrice": "0.010000",
          "maxPrice": "100.000000",
          "protocols": ["mpp", "x402"]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "Contribution amount in cents (USDC). Must be between 1 and 10000."
                  }
                },
                "required": ["amount"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Contribution successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "amount": {
                      "type": "integer",
                      "description": "The contributed amount in cents."
                    },
                    "contribution_id": {
                      "type": "string",
                      "description": "Unique identifier for the contribution."
                    },
                    "impact": {
                      "type": "string",
                      "description": "Human-readable description of the environmental impact."
                    }
                  },
                  "required": ["amount", "contribution_id", "impact"]
                }
              }
            }
          },
          "400": {
            "description": "Invalid or missing JSON body, or amount not an integer between 1 and 10000."
          },
          "402": {
            "description": "Payment Required. Includes MPP (WWW-Authenticate: Payment header) and x402 (PAYMENT-REQUIRED header) challenge headers."
          }
        }
      }
    }
  }
}
