--- name: upstage-document-parse description: Parse documents (PDF, images, DOCX, PPTX, XLSX, HWP) using Upstage Document Parse API. Extracts text, tables, figures, and layout elements with bounding boxes. Use when user asks to parse, extract, or analyze document content, convert documents to markdown/HTML, or extract structured data from PDFs and images. homepage: https://console.upstage.ai/api/document-digitization/document-parsing metadata: {"openclaw":{"emoji":"📑","requires":{"bins":["curl"],"env":["UPSTAGE_API_KEY"]},"primaryEnv":"UPSTAGE_API_KEY"}} --- # Upstage Document Parse Extract structured content from documents using Upstage's Document Parse API. ## Supported Formats PDF (up to 1000 pages with async), PNG, JPG, JPEG, TIFF, BMP, GIF, WEBP, DOCX, PPTX, XLSX, HWP ## Installation ```bash clawhub install upstage-document-parse ``` ## API Key Setup 1. Get your API key from [Upstage Console](https://console.upstage.ai) 2. Configure the API key: ```bash openclaw config set skills.entries.upstage-document-parse.apiKey "your-api-key" ``` Or add to `~/.openclaw/openclaw.json`: ```json5 { "skills": { "entries": { "upstage-document-parse": { "apiKey": "your-api-key" } } } } ``` ## Usage Examples Just ask the agent to parse your document: ``` "Parse this PDF: ~/Documents/report.pdf" "Parse: ~/Documents/report.jpg" ``` --- ## Sync API (Small Documents) For small documents (recommended < 20 pages). ### Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `model` | string | required | Use `document-parse` (latest) or `document-parse-nightly` | | `document` | file | required | Document file to parse | | `mode` | string | `standard` | `standard` (text-focused), `enhanced` (complex tables/images), `auto` | | `ocr` | string | `auto` | `auto` (images only) or `force` (always OCR) | | `output_formats` | string | `['html']` | `text`, `html`, `markdown` (array format) | | `coordinates` | boolean | `true` | Include bounding box coordinates | | `base64_encoding` | string | `[]` | Elements to base64: `["table"]`, `["figure"]`, etc. | | `chart_recognition` | boolean | `true` | Convert charts to tables (Beta) | | `merge_multipage_tables` | boolean | `false` | Merge tables across pages (Beta, max 20 pages if true) | ### Basic Parsing ```bash curl -X POST "https://api.upstage.ai/v1/document-digitization" \ -H "Authorization: Bearer $UPSTAGE_API_KEY" \ -F "document=@/path/to/file.pdf" \ -F "model=document-parse" ``` ### Extract Markdown ```bash curl -X POST "https://api.upstage.ai/v1/document-digitization" \ -H "Authorization: Bearer $UPSTAGE_API_KEY" \ -F "document=@report.pdf" \ -F "model=document-parse" \ -F "output_formats=['markdown']" ``` ### Enhanced Mode for Complex Documents ```bash curl -X POST "https://api.upstage.ai/v1/document-digitization" \ -H "Authorization: Bearer $UPSTAGE_API_KEY" \ -F "document=@complex.pdf" \ -F "model=document-parse" \ -F "mode=enhanced" \ -F "output_formats=['html', 'markdown']" ``` ### Force OCR for Scanned Documents ```bash curl -X POST "https://api.upstage.ai/v1/document-digitization" \ -H "Authorization: Bearer $UPSTAGE_API_KEY" \ -F "document=@scan.pdf" \ -F "model=document-parse" \ -F "ocr=force" ``` ### Extract Table Images as Base64 ```bash curl -X POST "https://api.upstage.ai/v1/document-digitization" \ -H "Authorization: Bearer $UPSTAGE_API_KEY" \ -F "document=@invoice.pdf" \ -F "model=document-parse" \ -F "base64_encoding=['table']" ``` --- ## Response Structure ```json { "api": "2.0", "model": "document-parse-251217", "content": { "html": "