{
  "openapi": "3.1.0",
  "info": {
    "title": "LensaOCR",
    "description": "Tesseract-compatible OCR over HTTP: send an image, get its text and word boxes in Tesseract's txt, TSV, hOCR and ALTO formats.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://lensaocr.saastemly.com"
    }
  ],
  "paths": {
    "/v1/ocr": {
      "post": {
        "operationId": "ocr",
        "summary": "Reads an image's text and word boxes (Tesseract txt, TSV, hOCR and ALTO).",
        "description": "Reads an image's text and word boxes (Tesseract txt, TSV, hOCR and ALTO).\n\nPrice: $0.005 per call (x402, or prepaid credits with an API key).",
        "x-price-usd": 0.005,
        "responses": {
          "200": {
            "description": "The result",
            "content": {
              "application/json": {
                "example": {
                  "text": "PACKING LIST 77\n",
                  "channel": "x402"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid (nothing is charged)"
          },
          "402": {
            "description": "Payment required: the x402 terms are in the PAYMENT-REQUIRED header; or send an API key"
          }
        },
        "security": [
          {},
          {
            "apiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image_base64": {
                    "type": "string",
                    "description": "A PNG image (up to 5 MB), base64-encoded"
                  },
                  "format": {
                    "type": "string",
                    "description": "The answer's format: text (default), tsv, hocr, alto or words",
                    "enum": [
                      "text",
                      "tsv",
                      "hocr",
                      "alto",
                      "words"
                    ]
                  }
                },
                "required": [
                  "image_base64"
                ]
              },
              "example": {
                "image_base64": "iVBORw0KGgoAAAANSUhEUg==",
                "format": "text"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key with prepaid credits, from https://lensaocr.saastemly.com"
      }
    }
  },
  "x-mcp-server": "https://lensaocr.saastemly.com/mcp"
}