模型 API
文档解析
使用 GLM-OCR 模型解析文档和图片的布局并提取文本内容。支持图片和PDF文档的OCR识别,返回详细的布局信息和可视化结果。点击 Try it 按钮可快速试用。
post/paas/v4/layout_parsing
Request body
Example request
{
"model": "glm-ocr",
"file": "https://cdn.bigmodel.cn/static/logo/introduction.png",
"user_id": "user_123456"
}Response
业务处理成功
Example response
{
"id": "task_123456789",
"created": 1727156815,
"model": "GLM-OCR",
"md_results": "# 文档标题\n这是文档内容...",
"layout_details": [
[
{
"index": 1,
"label": "text",
"bbox_2d": [
0.1,
0.1,
0.5,
0.3
],
"content": "这是文本内容",
"height": 800,
"width": 600
}
]
],
"data_info": {
"num_pages": 5,
"pages": [
{
"width": 600,
"height": 800
}
]
},
"request_id": "req_123456789"
}