{
  "openapi": "3.1.0",
  "info": {
    "title": "CobroClaro API",
    "version": "1.0.0",
    "description": "Generate payment reminder emails and discover the paid editable template kit."
  },
  "servers": [
    {
      "url": "https://cobroclaro.netlify.app"
    }
  ],
  "paths": {
    "/api/generate-reminder": {
      "get": {
        "operationId": "generateReminder",
        "summary": "Generate a payment reminder email",
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "es"
              ]
            }
          },
          {
            "name": "clientName",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoice",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dueDate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "daysOverdue",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tone",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "friendly",
                "firm",
                "final"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Generated email plus 0.01 USDC micro-tip instructions and paid kit metadata."
          }
        }
      },
      "post": {
        "operationId": "generateReminderPost",
        "summary": "Generate a payment reminder email from JSON input",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "es"
                    ]
                  },
                  "clientName": {
                    "type": "string"
                  },
                  "invoice": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "string"
                  },
                  "dueDate": {
                    "type": "string"
                  },
                  "daysOverdue": {
                    "type": "string"
                  },
                  "tone": {
                    "type": "string",
                    "enum": [
                      "friendly",
                      "firm",
                      "final"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated email plus 0.01 USDC micro-tip instructions and paid kit metadata."
          }
        }
      }
    },
    "/api/create-usdc-order": {
      "post": {
        "operationId": "createBaseUsdcOrder",
        "summary": "Create a Base USDC order for the paid editable kit",
        "responses": {
          "200": {
            "description": "Signed order token, exact USDC amount, wallet address, token contract and expiry."
          }
        }
      }
    },
    "/api/create-agent-checkout": {
      "post": {
        "operationId": "createAgentCheckout",
        "summary": "Create an agent-friendly paid kit checkout with wallet URI, QR URL and verification URL",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rail": {
                    "type": "string",
                    "enum": [
                      "base-usdc",
                      "base-eth",
                      "solana-usdc",
                      "btc"
                    ],
                    "default": "base-usdc"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Product metadata and complete payment instructions for autonomous purchase."
          }
        }
      }
    },
    "/api/create-tip-checkout": {
      "post": {
        "operationId": "createTipCheckout",
        "summary": "Create a 0.01 USDC micro-tip checkout for supporting the free tool",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rail": {
                    "type": "string",
                    "enum": [
                      "base-usdc",
                      "solana-usdc",
                      "base-eth",
                      "btc"
                    ],
                    "default": "base-usdc"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Micro-tip payment instructions with wallet URI and QR URL."
          }
        }
      }
    },
    "/api/paid-reminder-sequence": {
      "get": {
        "operationId": "getPaidReminderSequence",
        "summary": "HTTP 402 paid JSON reminder sequence unlocked by a 0.01 USDC Base payment, with demo=1 sample",
        "parameters": [
          {
            "name": "demo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Set demo=1 for a free one-step schema sample."
          }
        ],
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.01",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE"
        },
        "responses": {
          "200": {
            "description": "Premium JSON reminder sequence after x402 verification and settlement, or a one-step sample when demo=1."
          },
          "402": {
            "description": "Payment required. Includes a PAYMENT-REQUIRED header for a 0.01 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/api/paid-custom-reminder": {
      "post": {
        "operationId": "createPaidCustomReminder",
        "summary": "Dynamic x402 custom reminder sequence unlocked by a 0.002 USDC Base payment, with demo=1 sample",
        "parameters": [
          {
            "name": "demo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Set demo=1 for a free sample custom reminder sequence."
          }
        ],
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.002",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "clientName": {
                    "type": "string"
                  },
                  "invoice": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "string"
                  },
                  "dueDate": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "en",
                      "es"
                    ]
                  },
                  "tone": {
                    "type": "string"
                  },
                  "senderName": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Custom reminder sequence after x402 verification and settlement, or a sample sequence when demo=1."
          },
          "402": {
            "description": "Payment required. Includes a PAYMENT-REQUIRED header for a 0.002 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/api/paid-url-extractor": {
      "post": {
        "operationId": "createPaidUrlExtraction",
        "summary": "Dynamic x402 URL extractor unlocked by a 0.002 USDC Base payment, with demo=1 sample",
        "parameters": [
          {
            "name": "demo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Set demo=1 for a free Example Domain schema sample."
          }
        ],
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.002",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "includeText": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "URL title, metadata, links, and text after x402 verification and settlement, or a sample extraction when demo=1."
          },
          "402": {
            "description": "Payment required. Includes a PAYMENT-REQUIRED header for a 0.002 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/api/paid-agent-market-intel": {
      "get": {
        "operationId": "getPaidAgentMarketIntel",
        "summary": "Dynamic x402 agent marketplace intelligence unlocked by a 0.002 USDC Base payment, with demo=1 sample",
        "parameters": [
          {
            "name": "demo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Set demo=1 for a free market-intelligence schema sample."
          }
        ],
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.002",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE"
        },
        "responses": {
          "200": {
            "description": "Live task-market and x402 directory intelligence after x402 verification and settlement, or a sample feed when demo=1."
          },
          "402": {
            "description": "Payment required. Includes a PAYMENT-REQUIRED header for a 0.002 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/api/paid-ohlcv-feed": {
      "get": {
        "operationId": "getPaidOhlcvFeed",
        "summary": "x402 BTC/ETH OHLCV feed unlocked by a 0.01 USDC Base payment",
        "parameters": [
          {
            "name": "symbols",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "BTC,ETH"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 30,
              "maximum": 365,
              "example": 365
            }
          },
          {
            "name": "demo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ]
            },
            "description": "Set demo=1 for a free seven-candle sample with the same JSON schema."
          }
        ],
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.01",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE"
        },
        "responses": {
          "200": {
            "description": "BTC/ETH daily OHLCV candles after x402 verification and settlement, or a seven-candle sample when demo=1."
          },
          "402": {
            "description": "Payment required. Includes a PAYMENT-REQUIRED header for a 0.01 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/api/paid-subject-lines": {
      "get": {
        "operationId": "getPaidSubjectLines",
        "summary": "Low-friction x402 subject line pack unlocked by a 0.001 USDC Base payment, with demo=1 sample",
        "parameters": [
          {
            "name": "demo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Set demo=1 for a free three-subject-line schema sample."
          }
        ],
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.001",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE"
        },
        "responses": {
          "200": {
            "description": "Subject line pack after x402 verification and settlement, or a three-line sample when demo=1."
          },
          "402": {
            "description": "Payment required. Includes a PAYMENT-REQUIRED header for a 0.001 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/api/paid-skill-md": {
      "get": {
        "operationId": "getPaidCobroClaroSkillMd",
        "summary": "x402 paid installable SKILL.md for agents using CobroClaro invoice reminder tools",
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.001",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE"
        },
        "responses": {
          "200": {
            "description": "Markdown SKILL.md after x402 verification and settlement."
          },
          "402": {
            "description": "Payment required. Includes a PAYMENT-REQUIRED header for a 0.001 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/mcp": {
      "get": {
        "operationId": "getMcpMetadata",
        "summary": "Discover CobroClaro MCP tools and x402 pricing",
        "responses": {
          "200": {
            "description": "MCP server metadata, available tools and x402 pricing."
          }
        }
      },
      "post": {
        "operationId": "callCobroClaroMcp",
        "summary": "MCP initialize, tools/list, and x402-paid tools/call for invoice reminder tools",
        "x-payment-info": {
          "protocol": "x402",
          "facilitatorUrl": "https://facilitator.openx402.ai",
          "amount": "0.002",
          "currency": "USDC",
          "network": "eip155:8453",
          "paymentHeader": "PAYMENT-REQUIRED",
          "retryHeader": "PAYMENT-SIGNATURE",
          "note": "initialize and tools/list are free; tools/call requires x402 payment."
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "default": "2.0"
                  },
                  "id": {
                    "type": [
                      "string",
                      "number",
                      "null"
                    ]
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "initialize",
                      "notifications/initialized",
                      "tools/list",
                      "tools/call"
                    ]
                  },
                  "params": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response after free discovery or paid tool execution."
          },
          "402": {
            "description": "Payment required for tools/call. Includes payment requirements for a 0.002 USDC Base mainnet x402 payment."
          }
        }
      }
    },
    "/api/create-base-eth-order": {
      "post": {
        "operationId": "createBaseEthOrder",
        "summary": "Create a Base ETH order for the paid editable kit",
        "responses": {
          "200": {
            "description": "Signed order token, exact ETH amount, wallet address and expiry."
          }
        }
      }
    },
    "/api/create-solana-usdc-order": {
      "post": {
        "operationId": "createSolanaUsdcOrder",
        "summary": "Create a Solana USDC order for the paid editable kit",
        "responses": {
          "200": {
            "description": "Signed order token, exact USDC amount, Solana wallet address, USDC mint and expiry."
          }
        }
      }
    },
    "/api/create-order": {
      "post": {
        "operationId": "createBitcoinOrder",
        "summary": "Create a Bitcoin order for the paid editable kit",
        "responses": {
          "200": {
            "description": "Signed order token, exact BTC amount, Bitcoin address and expiry."
          }
        }
      }
    },
    "/api/verify-usdc-order": {
      "post": {
        "operationId": "verifyBaseUsdcOrder",
        "summary": "Verify a Base USDC order and return the download URL when paid",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order"
                ],
                "properties": {
                  "order": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment status and gated kit download URL when paid."
          }
        }
      }
    },
    "/api/verify-base-eth-order": {
      "post": {
        "operationId": "verifyBaseEthOrder",
        "summary": "Verify a Base ETH order and return the download URL when paid",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order"
                ],
                "properties": {
                  "order": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment status and gated kit download URL when paid."
          }
        }
      }
    },
    "/api/verify-solana-usdc-order": {
      "post": {
        "operationId": "verifySolanaUsdcOrder",
        "summary": "Verify a Solana USDC order and return the download URL when paid",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order"
                ],
                "properties": {
                  "order": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment status and gated kit download URL when paid."
          }
        }
      }
    },
    "/api/verify-order": {
      "post": {
        "operationId": "verifyBitcoinOrder",
        "summary": "Verify a Bitcoin order and return the download URL when paid",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "order"
                ],
                "properties": {
                  "order": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Payment status and gated kit download URL when paid."
          }
        }
      }
    },
    "/.well-known/pay.json": {
      "get": {
        "operationId": "getPaymentDiscovery",
        "summary": "Discover CobroClaro product pricing, checkout and crypto tip rails",
        "responses": {
          "200": {
            "description": "Machine-readable payment discovery manifest."
          }
        }
      }
    },
    "/api/revenue-status": {
      "get": {
        "operationId": "getRevenueStatus",
        "summary": "Check whether CobroClaro has started receiving money or crypto",
        "responses": {
          "200": {
            "description": "Compact revenue status across Base USDC, Base ETH, Solana USDC and Bitcoin."
          }
        }
      }
    }
  }
}
