Use the GLM-OCR model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.
Image or PDF document to be recognized, supports URL and base64. Supported image formats: PDF, JPG, PNG. Single image ≤10MB, PDF ≤50MB, maximum support 30 pages
Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Overview - Z.AI DEVELOPER DOCUMENT","description":"Use GLM models like GLM-5.3 \u0026 GLM-5.3-FLASH for AI coding in Claude Code, Kilo Code, Cline, OpenCode, Clawdbot/OpenClaw and more. Plans from $18/month—fast, reliable code generation and tool use for daily dev work.","colors":{"primary":"#141618","light":"#9fa0a0","dark":"#141618"},"logo":{"light":"https://mintcdn.com/zhipu-32152247/B_E8wI-eiNa1QlPV/logo/dark.svg?fit=max\u0026auto=format\u0026n=B_E8wI-eiNa1QlPV\u0026q=85\u0026s=75deefa9dea5bdbc84d4da68885c267f","dark":"https://mintcdn.com/zhipu-32152247/B_E8wI-eiNa1QlPV/logo/light.svg?fit=max\u0026auto=format\u0026n=B_E8wI-eiNa1QlPV\u0026q=85\u0026s=c1ecf1af358fa8eeab8c06052337f8f6","href":"https://z.ai/model-api"},"favicon":"https://mintcdn.com/zhipu-32152247/ZWmez2h5N6TCeIMS/favicon.svg?fit=max\u0026auto=format\u0026n=ZWmez2h5N6TCeIMS\u0026q=85\u0026s=f41adc4aa1fc28f2be33d46791810b1f","api":{"openapi":["openapi.json"],"params":{"expanded":"all"},"playground":{"display":"interactive","proxy":false},"examples":{"defaults":"all","languages":["bash","python","javascript","java"],"prefill":true}},"appearance":{"default":"dark","strict":false},"navbar":{"links":[{"href":"https://z.ai/manage-apikey/apikey-list","label":"API Keys"},{"href":"https://z.ai/manage-apikey/billing","label":"Payment Method"}]},"footer":{"socials":{"x":"https://x.com/Zai_org","github":"https://github.com/zai-org","discord":"https://discord.gg/QR7SARHRxK","linkedin":"https://www.linkedin.com/company/zdotai"}},"contextual":{"options":["copy","view"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"zhipu-32152247","hasAudioNarration":false,"actualSubdomain":"zhipu-32152247","customDomains":["docs.z.ai"],"gitSource":{"type":"github","owner":"zai-doc","repo":"zai-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae457d6ae091ec13e31ce9f","collectionId":"44a7ea14-96eb-4285-bf4c-72fd51b47979","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae457d6ae091ec13e31ce9f"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ae457d6ae091ec13e31ce9f","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Guides","count":25},{"language":"default","tag":"API Reference","count":18},{"language":"default","tag":"Coding Plan","count":18},{"language":"default","tag":"Get Started","count":10},{"language":"default","tag":"Guide","count":8},{"language":"default","tag":"Capabilities","count":7},{"language":"default","tag":"SDKs Guide","count":5},{"language":"default","tag":"Agent API","count":4},{"language":"default","tag":"Tool API","count":4},{"language":"default","tag":"GLM Coding Plan","count":4}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#footer div:last-child{display:none}.md\\:h-10{height:3rem}.prose-dark :where(a):not(:where([class~=not-prose],[class~=not-prose] *)),.prose-dark :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900}"}],"page":{"pagePath":"api-reference/tools/layout-parsing","slug":"/api-reference/tools/layout-parsing","pageMetadata":{"title":"Layout Parsing","openapi":"POST /paas/v4/layout_parsing","description":"Use the [GLM-OCR](/guides/vlm/glm-ocr) model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.","href":"/api-reference/tools/layout-parsing"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Use the \", _jsx(_components.a, {\n href: \"/guides/vlm/glm-ocr\",\n children: \"GLM-OCR\"\n }), \" model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Layout Parsing","openapi":"POST /paas/v4/layout_parsing","description":"Use the [GLM-OCR](/guides/vlm/glm-ocr) model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.","href":"/api-reference/tools/layout-parsing"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Layout Parsing","description":"Use the [GLM-OCR](/guides/vlm/glm-ocr) model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.","requestBody":"b5c6e6bd-98c1-4b14-84e3-5e8e86d86a9b","responses":{"200":"e0e0032d-e3f2-4250-bd0a-6599687fa02d","default":"6b565b4a-5dbc-4057-85c8-9cf69071f4d7"},"method":"post","type":"path","servers":["6d656395-5221-49af-96d5-e56c4cf5568b"],"security":["3d8be473-071c-4e09-8522-b9c2a59933dc"],"path":"/paas/v4/layout_parsing","baseUrlOptions":["https://api.z.ai/api"],"title":"Layout Parsing","codeSamples":[],"requestExampleLanguages":["bash","python","javascript","java"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"glm-ocr","body.file":"https://cdn.bigmodel.cn/static/logo/introduction.png"}],"disableProxy":true},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["model","file"],"properties":{"model":{"type":"string","description":"Model code: `glm-ocr`","example":"glm-ocr","enum":["glm-ocr"],"isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"file":{"type":"string","description":"Image or PDF document to be recognized, supports URL and base64. Supported image formats: PDF, JPG, PNG. Single image ≤10MB, PDF ≤50MB, maximum support 30 pages","example":"https://cdn.bigmodel.cn/static/logo/introduction.png","isRequired":true,"uniqueKey":"file","typeLabel":"string"},"return_crop_images":{"type":"boolean","description":"Whether to return screenshot information","default":false,"uniqueKey":"return_crop_images","typeLabel":"boolean"},"need_layout_visualization":{"type":"boolean","description":"Whether to return detailed layout image result information","default":false,"uniqueKey":"need_layout_visualization","typeLabel":"boolean"},"start_page_id":{"type":"integer","description":"Start page number for parsing when PDF is provided","minimum":1,"uniqueKey":"start_page_id","typeLabel":"integer"},"end_page_id":{"type":"integer","description":"End page number for parsing when PDF is provided","minimum":1,"uniqueKey":"end_page_id","typeLabel":"integer"},"request_id":{"type":"string","description":"Passed by the user side, needs to be unique; used to distinguish each request, 6–64 characters. If not provided by the user side, the platform will generate one by default.","minLength":6,"maxLength":64,"uniqueKey":"request_id","typeLabel":"string"},"user_id":{"type":"string","description":"Unique ID for the end user, 6–128 characters. Avoid using sensitive information.","minLength":6,"maxLength":128,"uniqueKey":"user_id","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Layout Parsing Example":{"title":"Layout Parsing Example","value":{"model":"glm-ocr","file":"https://cdn.bigmodel.cn/static/logo/introduction.png"}}},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"e0e0032d-e3f2-4250-bd0a-6599687fa02d":{"description":"Business processing successful","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Task ID","example":"task_123456789","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"created":{"type":"integer","format":"int64","description":"Request creation time, Unix timestamp in seconds","example":1727156815,"isRequired":true,"uniqueKey":"created","typeLabel":"integer\u003cint64>"},"model":{"type":"string","description":"Model name","example":"GLM-OCR","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"md_results":{"type":"string","description":"Recognition result in Markdown format","example":"# Doc title\nThis is the document content...","uniqueKey":"md_results","typeLabel":"string"},"layout_details":{"type":"array","description":"Detailed layout information","items":{"type":"array","items":{"type":"object","description":"Layout detail element","properties":{"index":{"type":"integer","description":"Element index","example":1,"isRequired":true,"uniqueKey":"layout_details.items.[INDEX].items.[INDEX].index","typeLabel":"integer"},"label":{"type":"string","description":"Element type: image for images, text for text content, formula for inline formulas, table for tables","enum":["image","text","formula","table"],"example":"text","isRequired":true,"uniqueKey":"layout_details.items.[INDEX].items.[INDEX].label","typeLabel":"enum\u003cstring>"},"bbox_2d":{"type":"array","description":"Normalized element coordinates [x1,y1,x2,y2]","items":{"type":"number","minimum":0,"maximum":1,"uniqueKey":"layout_details.items.[INDEX].items.[INDEX].bbox_2d.items.[INDEX]","typeLabel":"number"},"minItems":4,"maxItems":4,"example":[0.1,0.1,0.5,0.3],"uniqueKey":"layout_details.items.[INDEX].items.[INDEX].bbox_2d","typeLabel":"number[]"},"content":{"type":"string","description":"Element content (text / image URL / table HTML)","example":"This is the content of the element","uniqueKey":"layout_details.items.[INDEX].items.[INDEX].content","typeLabel":"string"},"height":{"type":"integer","description":"Page height","example":800,"uniqueKey":"layout_details.items.[INDEX].items.[INDEX].height","typeLabel":"integer"},"width":{"type":"integer","description":"Page width","example":600,"uniqueKey":"layout_details.items.[INDEX].items.[INDEX].width","typeLabel":"integer"}},"required":["index","label"],"uniqueKey":"layout_details.items.[INDEX].items.[INDEX]","typeLabel":"object"},"uniqueKey":"layout_details.items.[INDEX]","typeLabel":"object[]"},"uniqueKey":"layout_details","typeLabel":"object[][]"},"layout_visualization":{"type":"array","description":"Recognition result image URLs","items":{"type":"string","uniqueKey":"layout_visualization.items.[INDEX]","typeLabel":"string"},"uniqueKey":"layout_visualization","typeLabel":"string[]"},"data_info":{"type":"object","description":"Document basic information","properties":{"num_pages":{"type":"integer","description":"Total number of document pages","example":5,"isRequired":true,"uniqueKey":"data_info.num_pages","typeLabel":"integer"},"pages":{"type":"array","description":"Document page count information","items":{"type":"object","description":"Page dimension information","properties":{"width":{"type":"integer","description":"Page width","example":600,"isRequired":true,"uniqueKey":"data_info.pages.items.[INDEX].width","typeLabel":"integer"},"height":{"type":"integer","description":"Page height","example":800,"isRequired":true,"uniqueKey":"data_info.pages.items.[INDEX].height","typeLabel":"integer"}},"required":["width","height"],"uniqueKey":"data_info.pages.items.[INDEX]","typeLabel":"object"},"uniqueKey":"data_info.pages","typeLabel":"object[]"}},"required":["num_pages"],"uniqueKey":"data_info","typeLabel":"object"},"usage":{"type":"object","description":"Token usage statistics returned when the model call ends.","properties":{"prompt_tokens":{"type":"number","description":"Number of tokens in user input","uniqueKey":"usage.prompt_tokens","typeLabel":"number"},"completion_tokens":{"type":"number","description":"Number of output tokens","uniqueKey":"usage.completion_tokens","typeLabel":"number"},"prompt_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"number","description":"Number of tokens served from cache","uniqueKey":"usage.prompt_tokens_details.cached_tokens","typeLabel":"number"}},"uniqueKey":"usage.prompt_tokens_details","typeLabel":"object"},"total_tokens":{"type":"integer","description":"Total number of tokens","uniqueKey":"usage.total_tokens","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"},"request_id":{"type":"string","description":"Request ID","example":"req_123456789","uniqueKey":"request_id","typeLabel":"string"}},"required":["id","created","model"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"task_123456789","created":1727156815,"model":"GLM-OCR","md_results":"# Doc title\nThis is the document content...","layout_details":[[{"index":1,"label":"text","bbox_2d":[0.1,0.1,0.5,0.3],"content":"This is the content of the element","height":800,"width":600}]],"layout_visualization":["\u003cstring>"],"data_info":{"num_pages":5,"pages":[{"width":600,"height":800}]},"usage":{"prompt_tokens":123,"completion_tokens":123,"prompt_tokens_details":{"cached_tokens":123},"total_tokens":123},"request_id":"req_123456789"}}},"exampleType":"generated"}},"exampleType":"generated"},"6b565b4a-5dbc-4057-85c8-9cf69071f4d7":{"description":"Request failed.","content":{"application/json":{"schema":{"required":["code","message"],"type":"object","description":"The request has failed.","properties":{"code":{"type":"integer","format":"int32","description":"Error code.","isRequired":true,"uniqueKey":"code","typeLabel":"integer\u003cint32>"},"message":{"type":"string","description":"Error message.","isRequired":true,"uniqueKey":"message","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":123,"message":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"3d8be473-071c-4e09-8522-b9c2a59933dc":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Use the following format for authentication: Bearer [\u003cyour api key>](https://z.ai/manage-apikey/apikey-list)","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"6d656395-5221-49af-96d5-e56c4cf5568b":{"url":"https://api.z.ai/api","description":"Production server"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"Use the following format for authentication: Bearer [\u003cyour api key>](https://z.ai/manage-apikey/apikey-list)","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Use the following format for authentication: Bearer [\u003cyour api key>](https://z.ai/manage-apikey/apikey-list)","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi.json"},"subdomain":"zhipu-32152247","siteName":"Overview - Z.AI DEVELOPER DOCUMENT","title":"Layout Parsing - Overview - Z.AI DEVELOPER DOCUMENT","navMaps":{"firstHrefInVersion":{"English":{"href":"/api-reference/tools/layout-parsing","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-02-02T16:26:04.382Z","originalFileLocation":"api-reference/tools/layout-parsing.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use the GLM-OCR model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Layout Parsing - Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use the GLM-OCR model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.z.ai/api-reference/tools/layout-parsing\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://zhipu-32152247.mintlify.app/_mintlify/api/og/v2?division=Tool+API\u0026amp;title=Layout+Parsing\u0026amp;description=Use+the+%5BGLM-OCR%5D%28%2Fguides%2Fvlm%2Fglm-ocr%29+model+to+parse+the+layout+of+documents+and+images+and+extract+text+content.+Support+OCR+recognition+of+images+and+PDF+doc\u0026amp;theme=28cd11ffa578495b9d6a62e8\u0026amp;signature=e311f415a82d5ba3be1a3422e35c2f8359278d6ed0f57078842aba93d24e3178\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Layout Parsing - Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use the GLM-OCR model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zhipu-32152247.mintlify.app/_mintlify/api/og/v2?division=Tool+API\u0026amp;title=Layout+Parsing\u0026amp;description=Use+the+%5BGLM-OCR%5D%28%2Fguides%2Fvlm%2Fglm-ocr%29+model+to+parse+the+layout+of+documents+and+images+and+extract+text+content.+Support+OCR+recognition+of+images+and+PDF+doc\u0026amp;theme=28cd11ffa578495b9d6a62e8\u0026amp;signature=e311f415a82d5ba3be1a3422e35c2f8359278d6ed0f57078842aba93d24e3178\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/zhipu-32152247/ksfquWFAc8TQf_Hb/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Overview - Z.AI DEVELOPER DOCUMENT\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#141618\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.z.ai/api-reference/tools/layout-parsing\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/tools/layout-parsing.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.z.ai/#organization\",\"name\":\"Overview - Z.AI DEVELOPER DOCUMENT\",\"url\":\"https://docs.z.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/zhipu-32152247/B_E8wI-eiNa1QlPV/logo/dark.svg?fit=max\u0026auto=format\u0026n=B_E8wI-eiNa1QlPV\u0026q=85\u0026s=75deefa9dea5bdbc84d4da68885c267f\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.z.ai#website\",\"name\":\"Overview - Z.AI DEVELOPER DOCUMENT\",\"url\":\"https://docs.z.ai\",\"publisher\":{\"@id\":\"https://docs.z.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.z.ai/api-reference/tools/layout-parsing#webpage\",\"url\":\"https://docs.z.ai/api-reference/tools/layout-parsing\",\"name\":\"Layout Parsing\",\"description\":\"Use the GLM-OCR model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.\",\"dateModified\":\"2026-02-02T16:26:04.382Z\",\"isPartOf\":{\"@id\":\"https://docs.z.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.z.ai/api-reference/tools/layout-parsing#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.z.ai/api-reference/tools/layout-parsing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tool API\",\"item\":\"https://docs.z.ai/api-reference/tools/tokenizer\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Layout Parsing\",\"item\":\"https://docs.z.ai/api-reference/tools/layout-parsing\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.z.ai/api-reference/tools/layout-parsing#apireference\",\"headline\":\"Layout Parsing\",\"name\":\"Layout Parsing\",\"description\":\"Use the GLM-OCR model to parse the layout of documents and images and extract text content. Support OCR recognition of images and PDF documents, returning detailed layout information and visualization results.\",\"url\":\"https://docs.z.ai/api-reference/tools/layout-parsing\",\"mainEntityOfPage\":{\"@id\":\"https://docs.z.ai/api-reference/tools/layout-parsing#webpage\"},\"dateModified\":\"2026-02-02T16:26:04.382Z\",\"publisher\":{\"@id\":\"https://docs.z.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.z.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Overview - Z.AI DEVELOPER DOCUMENT\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Overview - Z.AI DEVELOPER DOCUMENT","nav":{"global":null,"versions":[{"version":"English","tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":"/guides/overview/quick-start"}]},{"tab":"API Reference","groups":[{"group":"Using the APIs","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"Errors","href":"/api-reference/api-code"},{"title":"Rate Limits","url":"https://z.ai/manage-apikey/rate-limits","href":"/api-reference/rate-limit"}]},{"group":"Model API","pages":[{"title":"Chat Completion","openapi":"POST /paas/v4/chat/completions","href":"/api-reference/llm/chat-completion"}]},{"group":"Image API","pages":[{"title":"Generate Image","openapi":"POST /paas/v4/images/generations","href":"/api-reference/image/generate-image"},{"title":"Generate Image(Async)","openapi":"POST /paas/v4/async/images/generations","href":"/api-reference/image/generate-image-async"},{"title":"Retrieve Result","openapi":"GET /paas/v4/async-result/{id}","href":"/api-reference/image/get-image-status"}]},{"group":"Video API","pages":[{"title":"Generate Video(Async)","openapi":"POST /paas/v4/videos/generations","href":"/api-reference/video/generate-video"},{"title":"Retrieve Result","openapi":"GET /paas/v4/async-result/{id}","href":"/api-reference/video/get-video-status"}]},{"group":"Audio API","pages":[{"title":"Audio Transcriptions","openapi":"POST /paas/v4/audio/transcriptions","href":"/api-reference/audio/audio-transcriptions"}]},{"group":"Tool API","pages":[{"title":"Tokenizer","openapi":"POST /paas/v4/tokenizer","description":"`Tokenizer` is used to split text into `tokens` recognizable by the model and calculate the count. It receives user input text, processes it through the model for tokenization, and finally returns the corresponding `token` count. It is suitable for text length evaluation, model input estimation, dialogue context truncation, cost calculation, etc.","href":"/api-reference/tools/tokenizer"},{"title":"Layout Parsing","openapi":"POST /paas/v4/layout_parsing","href":"/api-reference/tools/layout-parsing"},{"title":"Web Search","openapi":"POST /paas/v4/web_search","description":"The [Web Search](/guides/tools/web-search) is a specialized search engine for large language models. Building upon traditional search engine capabilities like web crawling and ranking, it enhances intent recognition to return results better suited for LLM processing (including webpage titles, URLs, summaries, site names, favicons etc.).","href":"/api-reference/tools/web-search"},{"title":"Web Reader","openapi":"POST /paas/v4/reader","href":"/api-reference/tools/web-reader"}]},{"group":"Agent API","pages":[{"title":"Agent Chat","openapi":"POST /v1/agents","href":"/api-reference/agents/agent"},{"title":"File Upload","openapi":"POST /paas/v4/files","href":"/api-reference/agents/file-upload"},{"title":"Retrieve Result","openapi":"POST /v1/agents/async-result","href":"/api-reference/agents/get-async-result"},{"title":"Conversation History","openapi":"POST /v1/agents/conversation","href":"/api-reference/agents/agent-conversation"}]}]},{"tab":"Coding Plan","pages":[{"title":"Coding Plan","href":"/devpack/overview"}]},{"tab":"Released Notes","pages":[{"title":"Released Notes","href":"/release-notes/new-released"}]},{"tab":"Terms and Policy","pages":[{"title":"Terms and Policy","href":"/legal-agreement/privacy-policy"}]},{"tab":"Help Center","pages":[{"title":"Help Center","href":"/help/faq"}]}]}]},"basePath":"","title":"Layout Parsing - Overview - Z.AI DEVELOPER DOCUMENT","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-CS552b7R.js","utils-DDTCYAF2.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-De8ttokP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DrwRDvAh.js","snippetPresets-DtAN0nWx.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-D5rWArI6.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-O2i12wsz.js","shallow-DV8xABTt.js","getApiPlaygroundDisplay-DBZ0B5Jx.js","CodeSnippet-BVi0tPUX.js","CodeSnippets-CqASbIwY.js","Page-m07pfKpT.js","getPastedJson-DG9vsMS8.js","icon-CXzRSCr8.js","MethodPill-BdKVtEuX.js","DuplicateIcon-CZlmBrJI.js","createIcon-biFEUKPL.js","DynamicMarkdown-B54_zNBF.js","SectionHeading-DwwHK3Pt.js","axios-vUo_bRtp.js","Markdown-DfhCTwyA.js","clsx-xpJZXxdP.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-BTZUMDnx.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-DqdKa2R4.js"]}