Skip to main content
POST
Layout Parsing

Authorizations

Authorization
string
header
required

Use the following format for authentication: Bearer

Body

application/json
model
enum<string>
required

Model code: glm-ocr

Available options:
glm-ocr
Example:

"glm-ocr"

file
string
required

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"

return_crop_images
boolean
default:false

Whether to return screenshot information

need_layout_visualization
boolean
default:false

Whether to return detailed layout image result information

start_page_id
integer

Start page number for parsing when PDF is provided

Required range: x >= 1
end_page_id
integer

End page number for parsing when PDF is provided

Required range: x >= 1
request_id
string

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.

Required string length: 6 - 64
user_id
string

Unique ID for the end user, 6–128 characters. Avoid using sensitive information.

Required string length: 6 - 128

Response

Business processing successful

id
string
required

Task ID

Example:

"task_123456789"

created
integer<int64>
required

Request creation time, Unix timestamp in seconds

Example:

1727156815

model
string
required

Model name

Example:

"GLM-OCR"

md_results
string

Recognition result in Markdown format

Example:

"# Doc title\nThis is the document content..."

layout_details
object[][]

Detailed layout information

layout_visualization
string[]

Recognition result image URLs

data_info
object

Document basic information

usage
object

Token usage statistics returned when the model call ends.

request_id
string

Request ID

Example:

"req_123456789"