{
 "openapi": "3.0.3",
 "info": {
  "title": "Charts, diagrams and figures (commercial): TeleOCR Region mode",
  "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": "Charts, diagrams and figures",
  "need": "Data values out of charts, flowcharts to structure, figures to editable form.",
  "role": "commercial",
  "space": "hugging-apps/teleocr-document-parsing",
  "space_url": "https://huggingface.co/spaces/hugging-apps/teleocr-document-parsing",
  "model": "TeleOCR Region mode",
  "license": "Apache-2.0",
  "license_class": "open",
  "gpu_seconds_booked": "\u224886",
  "notes": "Commercially usable table and chart extraction.",
  "caveats": "",
  "lineup_call": "/parse_document(image, layout_mode=\"Region\", region_task=\"table\"|\"char\") \u2192 Markdown, JSON",
  "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": "Data values out of charts, flowcharts to structure, figures to editable form. 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. \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_charts_diagrams_and_figures_commercial",
    "tags": [
     "Documents and visual understanding"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ],
    "summary": "Charts, diagrams and figures (commercial): TeleOCR Region mode",
    "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_charts_diagrams_and_figures_commercial_result",
    "tags": [
     "Documents and visual understanding"
    ],
    "security": [
     {
      "hfToken": []
     },
     {}
    ]
   }
  }
 }
}