{
 "openapi": "3.0.3",
 "info": {
  "title": "Document OCR to Markdown (commercial): TeleOCR (~1.2B)",
  "version": "2026-11-21",
  "description": "Curated ZeroGPU tool from the ZeroGPU lineup catalog. Calls go straight to the upstream Space hugging-apps/teleocr-document-parsing; send your own HF token as a bearer token so the call uses your ZeroGPU quota."
 },
 "servers": [
  {
   "url": "https://hugging-apps-teleocr-document-parsing.hf.space"
  }
 ],
 "x-zerogpu": {
  "category": "Documents and visual understanding",
  "slot": "Document OCR to Markdown",
  "need": "Faithful text, tables, formulas and layout from scans, photos and PDFs.",
  "role": "commercial",
  "space": "hugging-apps/teleocr-document-parsing",
  "space_url": "https://huggingface.co/spaces/hugging-apps/teleocr-document-parsing",
  "model": "TeleOCR (~1.2B)",
  "license": "Apache-2.0",
  "license_class": "open",
  "gpu_seconds_booked": "\u224886",
  "notes": "The Apache lane, second on OmniDocBench v1.6 (96.91). Segmentation mode handles photographed and curved pages.",
  "caveats": "One page image per call, so the super Space must rasterize PDFs itself.",
  "lineup_call": "/parse_document(image, layout_mode=\"Detection\"|\"Segmentation\"|\"Region\", region_task=\"table\", drop_paratext=true, max_new_tokens=2048) \u2192 overlay, Markdown, blocks JSON, .md file",
  "api_style": "v1",
  "mcp_url": "https://hugging-apps-teleocr-document-parsing.hf.space/gradio_api/mcp/"
 },
 "components": {
  "securitySchemes": {
   "hfToken": {
    "type": "http",
    "scheme": "bearer",
    "description": "Your own Hugging Face token (read scope is enough). It is sent only to the upstream Space and bills that call to your account's ZeroGPU quota. Without it the call runs on the small anonymous quota."
   }
  },
  "schemas": {}
 },
 "paths": {
  "/gradio_api/call/parse_document": {
   "post": {
    "description": "Faithful text, tables, formulas and layout from scans, photos and PDFs. Step 1 of 2: returns {\"event_id\"}; then GET /gradio_api/call/parse_document/{event_id} reads an SSE stream whose `event: complete` data is the JSON output array (`event: error` on failure). Upstream: https://huggingface.co/spaces/hugging-apps/teleocr-document-parsing. License: Apache-2.0. Caveats: One page image per call, so the super Space must rasterize PDFs itself. \n\nUpstream description: Parse a document page into Markdown with TeleOCR.\nReturns, in order: Predicted regions (reading order): dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)); value_18: str; Markdown: str; Blocks: str | float | bool | list | dict; Download Markdown: filepath; value_9: str",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "data"
        ],
        "properties": {
         "data": {
          "type": "array",
          "minItems": 1,
          "maxItems": 5,
          "items": {},
          "description": "Positional inputs, in this order:\n0. image: dict(path: str | None (Path to a local file), url: str | None (Publicly available url or base64 encoded image), size: int | None (Size of image in bytes), orig_name: str | None (Original filename), mime_type: str | None (mime type of image), is_stream: bool (Can always be set to False), meta: dict(str, Any)) (required)\n1. layout_mode: Literal['Detection', 'Segmentation', 'Region'] (default \"Detection\")\n2. region_task: Literal['text', 'table', 'formula', 'code', 'char', 'seal'] (default \"table\")\n3. drop_paratext: bool (default true)\n4. max_new_tokens: float (default 2048)"
         }
        }
       }
      }
     }
    },
    "x-gradio-parameters": [
     {
      "name": "image",
      "schema": {
       "type": "object",
       "required": [
        "path",
        "meta"
       ],
       "description": "A file. Set path to a public https URL (or a path returned by POST /gradio_api/upload on the same Space) and meta to {\"_type\": \"gradio.FileData\"}.",
       "properties": {
        "path": {
         "type": "string"
        },
        "url": {
         "type": "string"
        },
        "orig_name": {
         "type": "string"
        },
        "meta": {
         "type": "object",
         "properties": {
          "_type": {
           "type": "string",
           "enum": [
            "gradio.FileData"
           ]
          }
         }
        }
       }
      },
      "required": true,
      "default": null
     },
     {
      "name": "layout_mode",
      "schema": {
       "enum": [
        "Detection",
        "Segmentation",
        "Region"
       ],
       "title": "Radio",
       "type": "string"
      },
      "required": false,
      "default": "Detection"
     },
     {
      "name": "region_task",
      "schema": {
       "type": "string",
       "enum": [
        "text",
        "table",
        "formula",
        "code",
        "char",
        "seal"
       ]
      },
      "required": false,
      "default": "table"
     },
     {
      "name": "drop_paratext",
      "schema": {
       "type": "boolean"
      },
      "required": false,
      "default": true
     },
     {
      "name": "max_new_tokens",
      "schema": {
       "type": "number",
       "description": "numeric value between 256 and 4096"
      },
      "required": false,
      "default": 2048
     }
    ],
    "operationId": "docs_vision_document_ocr_to_markdown_commercial",
    "tags": [
     "Documents and visual understanding"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Document OCR to Markdown (commercial): TeleOCR (~1.2B)",
    "responses": {
     "200": {
      "description": "Job accepted.",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "event_id"
         ],
         "properties": {
          "event_id": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/gradio_api/call/parse_document/{event_id}": {
   "get": {
    "summary": "Read the result stream for /parse_document",
    "description": "Server-sent events. The final `event: complete` carries a JSON array of outputs; `event: error` means the call failed.",
    "parameters": [
     {
      "name": "event_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SSE stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     }
    },
    "operationId": "docs_vision_document_ocr_to_markdown_commercial_result",
    "tags": [
     "Documents and visual understanding"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}