{
  "openapi": "3.1.0",
  "info": {
    "title": "Amazap Basics",
    "version": "1.0.0",
    "description": "First-party L402 APIs. Prices are USD and are paid in sats over Lightning."
  },
  "servers": [
    {
      "url": "https://amazap.com"
    }
  ],
  "x-service-info": {
    "categories": [
      "documents"
    ],
    "docs": {
      "homepage": "https://amazap.com",
      "llms": "https://amazap.com/llms.txt",
      "apiReference": "https://amazap.com/openapi.json"
    }
  },
  "paths": {
    "/basics/v1/markdown": {
      "get": {
        "operationId": "basicsMarkdown",
        "summary": "Page to Markdown",
        "description": "Reads one public web page and returns the article as Markdown. $0.01 a page, settled in sats. Unauthenticated GET or HEAD without the required input returns 402 with a WWW-Authenticate L402 challenge so public directories can index the endpoint. A malformed value is refused with 400 before an invoice. Price $0.01 USD, paid in sats over Lightning.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Public http or https page. Required on the paid call. Directory probes omit it and still receive 402.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "200": {
            "description": "The page as Markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "finalUrl": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "wordCount": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A paid L402 token was presented without the url parameter."
          },
          "402": {
            "description": "Payment Required. WWW-Authenticate uses the L402 scheme (macaroon, token, and a Lightning invoice). The price is $0.01 USD, paid in sats over Lightning.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "priceUsd": {
                      "type": "number",
                      "example": 0.01
                    },
                    "priceSats": {
                      "type": "integer"
                    },
                    "invoice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "Page to Markdown probe",
        "description": "Unauthenticated HEAD without the required input returns 402 and the same L402 challenge, with no body.",
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required. No response body. WWW-Authenticate: L402 with a Lightning invoice. The price is in USD, paid in sats.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/basics/v1/metadata": {
      "get": {
        "operationId": "basicsMetadata",
        "summary": "Page Metadata",
        "description": "Reads one public page and returns title, description, canonical URL, share image, favicon, language, links, and plain text. $0.01 a page, settled in sats. Unauthenticated GET or HEAD without the required input returns 402 with a WWW-Authenticate L402 challenge so public directories can index the endpoint. A malformed value is refused with 400 before an invoice. Price $0.01 USD, paid in sats over Lightning.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Public http or https URL. GET or HEAD without it is a 402 directory probe. A private or malformed URL is refused with 400 before an invoice.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "200": {
            "description": "The page as Markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "finalUrl": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "wordCount": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A paid L402 token was presented without the url parameter."
          },
          "402": {
            "description": "Payment Required. WWW-Authenticate uses the L402 scheme (macaroon, token, and a Lightning invoice). The price is $0.01 USD, paid in sats over Lightning.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "priceUsd": {
                      "type": "number",
                      "example": 0.01
                    },
                    "priceSats": {
                      "type": "integer"
                    },
                    "invoice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "Page Metadata probe",
        "description": "Unauthenticated HEAD without the required input returns 402 and the same L402 challenge, with no body.",
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required. No response body. WWW-Authenticate: L402 with a Lightning invoice. The price is in USD, paid in sats.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/basics/v1/screenshot": {
      "get": {
        "operationId": "basicsScreenshot",
        "summary": "Page Screenshot",
        "description": "Renders one public page to a PNG. Viewport defaults to 1280 by 800. $0.03 a capture, settled in sats. Unauthenticated GET or HEAD without the required input returns 402 with a WWW-Authenticate L402 challenge so public directories can index the endpoint. A malformed value is refused with 400 before an invoice. Price $0.03 USD, paid in sats over Lightning.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Public http or https URL. GET or HEAD without it is a 402 directory probe. A private or malformed URL is refused with 400 before an invoice.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.03,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.03",
              "currency": "USD",
              "priceUsd": 0.03,
              "description": "$0.03 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "200": {
            "description": "The page as Markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "finalUrl": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "wordCount": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A paid L402 token was presented without the url parameter."
          },
          "402": {
            "description": "Payment Required. WWW-Authenticate uses the L402 scheme (macaroon, token, and a Lightning invoice). The price is $0.03 USD, paid in sats over Lightning.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "priceUsd": {
                      "type": "number",
                      "example": 0.03
                    },
                    "priceSats": {
                      "type": "integer"
                    },
                    "invoice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "Page Screenshot probe",
        "description": "Unauthenticated HEAD without the required input returns 402 and the same L402 challenge, with no body.",
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.03,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.03",
              "currency": "USD",
              "priceUsd": 0.03,
              "description": "$0.03 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required. No response body. WWW-Authenticate: L402 with a Lightning invoice. The price is in USD, paid in sats.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/basics/v1/pdf": {
      "get": {
        "operationId": "basicsPdf",
        "summary": "PDF to Markdown",
        "description": "Fetches one public PDF (up to 20 MB) and returns the text as Markdown. $0.02 a file, settled in sats. Unauthenticated GET or HEAD without the required input returns 402 with a WWW-Authenticate L402 challenge so public directories can index the endpoint. A malformed value is refused with 400 before an invoice. Price $0.02 USD, paid in sats over Lightning.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Public http or https URL. GET or HEAD without it is a 402 directory probe. A private or malformed URL is refused with 400 before an invoice.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.02,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.02",
              "currency": "USD",
              "priceUsd": 0.02,
              "description": "$0.02 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "200": {
            "description": "The page as Markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "finalUrl": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "wordCount": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A paid L402 token was presented without the url parameter."
          },
          "402": {
            "description": "Payment Required. WWW-Authenticate uses the L402 scheme (macaroon, token, and a Lightning invoice). The price is $0.02 USD, paid in sats over Lightning.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "priceUsd": {
                      "type": "number",
                      "example": 0.02
                    },
                    "priceSats": {
                      "type": "integer"
                    },
                    "invoice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "PDF to Markdown probe",
        "description": "Unauthenticated HEAD without the required input returns 402 and the same L402 challenge, with no body.",
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.02,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.02",
              "currency": "USD",
              "priceUsd": 0.02,
              "description": "$0.02 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required. No response body. WWW-Authenticate: L402 with a Lightning invoice. The price is in USD, paid in sats.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/basics/v1/feed": {
      "get": {
        "operationId": "basicsFeed",
        "summary": "Feed Reader",
        "description": "Parses a public RSS or Atom feed, or finds the feed linked from an HTML page. $0.01 a feed, settled in sats. Unauthenticated GET or HEAD without the required input returns 402 with a WWW-Authenticate L402 challenge so public directories can index the endpoint. A malformed value is refused with 400 before an invoice. Price $0.01 USD, paid in sats over Lightning.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Public http or https URL. GET or HEAD without it is a 402 directory probe. A private or malformed URL is refused with 400 before an invoice.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "200": {
            "description": "The page as Markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "finalUrl": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "wordCount": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A paid L402 token was presented without the url parameter."
          },
          "402": {
            "description": "Payment Required. WWW-Authenticate uses the L402 scheme (macaroon, token, and a Lightning invoice). The price is $0.01 USD, paid in sats over Lightning.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "priceUsd": {
                      "type": "number",
                      "example": 0.01
                    },
                    "priceSats": {
                      "type": "integer"
                    },
                    "invoice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "Feed Reader probe",
        "description": "Unauthenticated HEAD without the required input returns 402 and the same L402 challenge, with no body.",
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required. No response body. WWW-Authenticate: L402 with a Lightning invoice. The price is in USD, paid in sats.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/basics/v1/qr": {
      "get": {
        "operationId": "basicsQr",
        "summary": "QR Code",
        "description": "Returns a QR image for text or a Lightning invoice. $0.01 an image, settled in sats. No page is fetched. Unauthenticated GET or HEAD without the required input returns 402 with a WWW-Authenticate L402 challenge so public directories can index the endpoint. A malformed value is refused with 400 before an invoice. Price $0.01 USD, paid in sats over Lightning.",
        "parameters": [
          {
            "name": "data",
            "in": "query",
            "required": false,
            "description": "Text or a Lightning invoice to encode. GET or HEAD without data is a 402 directory probe. A present but invalid value is refused with 400 before an invoice.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "png",
                "svg"
              ]
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 64,
              "maximum": 1024
            }
          }
        ],
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "200": {
            "description": "The page as Markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "finalUrl": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "markdown": {
                      "type": "string"
                    },
                    "wordCount": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A paid L402 token was presented without the url parameter."
          },
          "402": {
            "description": "Payment Required. WWW-Authenticate uses the L402 scheme (macaroon, token, and a Lightning invoice). The price is $0.01 USD, paid in sats over Lightning.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "service": {
                      "type": "string"
                    },
                    "priceUsd": {
                      "type": "number",
                      "example": 0.01
                    },
                    "priceSats": {
                      "type": "integer"
                    },
                    "invoice": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "head": {
        "summary": "QR Code probe",
        "description": "Unauthenticated HEAD without the required input returns 402 and the same L402 challenge, with no body.",
        "x-payment-info": {
          "protocol": "L402",
          "method": "lightning",
          "network": "Lightning",
          "intent": "charge",
          "currency": "USD",
          "priceUsd": 0.01,
          "offers": [
            {
              "intent": "charge",
              "protocol": "L402",
              "method": "lightning",
              "amount": "0.01",
              "currency": "USD",
              "priceUsd": 0.01,
              "description": "$0.01 USD per request, paid in sats over Lightning."
            }
          ]
        },
        "responses": {
          "402": {
            "description": "Payment Required. No response body. WWW-Authenticate: L402 with a Lightning invoice. The price is in USD, paid in sats.",
            "headers": {
              "WWW-Authenticate": {
                "description": "L402 macaroon=\"...\", token=\"...\", invoice=\"lnbc...\"",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
