/v2/parseParse API (v2)Parse a document image into structured output. Use output_format to select blocks or markdown (default).
Currently supports document.type = image_url only (data URI or remote http(s) image URL). PDF / file URL inputs are not yet supported.
Image limits: 20 MB file size; 50 megapixels or 200 MB decoded (whichever is exceeded first).
Parameters
X-Client-NamestringheaderThe name of the project that is making the request.
Request body
requiredapplication/json
documentobjectrequiredDocument to parse. Currently only `image_url` documents are supported.
Show child attributes
image_urlstringrequiredImage URL or base64 data URI to parse. Limits: - Maximum file size: 20 MB (compressed upload, download, or decoded data-URI payload) - Maximum decoded size: 50 megapixels or 200 MB decompressed (whichever is exceeded first)
typestringrequiredDiscriminator for the document payload.
modelstringrequiredThe name of a compatible Cohere parse model.
output_formatstringSelects the page payload shape in the response. Defaults to `"markdown"`. - `"markdown"`: each page includes markdown content. Tables are inlined as HTML, and images are referenced as `` with matching entries in `page.markdown.images`. - `"blocks"`: each page includes an ordered `blocks` array of text, image, and table content regions, including bounding boxes where available.
{
"document": {
"image_url": "string",
"type": "image_url"
},
"model": "string",
"output_format": "markdown"
}Responses
Response from the v2 parse endpoint.
finish_reasonstringThe reason a chat request has finished. - **complete**: The model finished sending a complete message. - **max_tokens**: The number of generated tokens exceeded the model's context length or the value specified via the `max_tokens` parameter. - **stop_sequence**: One of the provided `stop_sequence` entries was reached in the model's generation. - **tool_call**: The model generated a Tool Call and is expecting a Tool Message in return - **error**: The generation failed due to an internal error - **timeout**: The generation was stopped because it exceeded the allowed time limit.
idstringrequiredUnique identifier for the parse response.
metaobjectShow child attributes
api_versionobjectShow child attributes
is_deprecatedbooleanis_experimentalbooleanversionstringrequiredbilled_unitsobjectShow child attributes
classificationsnumberThe number of billed classifications units.
image_tokensnumberThe number of billed image tokens.
imagesnumberThe number of billed images.
input_tokensnumberThe number of billed input tokens.
output_tokensnumberThe number of billed output tokens.
pagesnumberThe number of billed pages parsed.
search_unitsnumberThe number of billed search units.
cached_tokensnumberThe number of prompt tokens that hit the inference cache.
tokensobjectShow child attributes
input_tokensnumberThe number of tokens used as input to the model.
output_tokensnumberThe number of tokens produced by the model.
warningsarray of stringShow child attributes
pagesarray of valuerequiredParsed pages in document order.
Show child attributes
Show array items
A single parsed page. The payload shape depends on `output_format`.
oneOf · 2 options
A parsed page with structured content blocks.
blocksarray of valuerequiredOrdered content blocks extracted from the page.
Show child attributes
Show array items
A content block on a parsed page.
oneOf · 3 options
A text content block.
textobjectrequiredPayload for a text block.
Show child attributes
contentstringrequiredExtracted text content.
typestringrequiredAn image content block.
imageobjectrequiredPayload for an image block.
Show child attributes
bounding_boxobjectrequiredA bounding box with pixel coordinates on the source document image.
Show child attributes
bottom_right_xintegerrequiredX coordinate of the bottom-right corner.
bottom_right_yintegerrequiredY coordinate of the bottom-right corner.
top_left_xintegerrequiredX coordinate of the top-left corner.
top_left_yintegerrequiredY coordinate of the top-left corner.
bounding_box_normalizedobjectrequiredA bounding box with coordinates in [0, 1] relative to the source page (model coordinates are thousandths of page width/height).
Show child attributes
bottom_right_xnumber · doublerequiredNormalized X coordinate of the bottom-right corner.
bottom_right_ynumber · doublerequiredNormalized Y coordinate of the bottom-right corner.
top_left_xnumber · doublerequiredNormalized X coordinate of the top-left corner.
top_left_ynumber · doublerequiredNormalized Y coordinate of the top-left corner.
categorystringrequiredImage element category.
descriptionstringrequiredModel-generated description of the image.
idstringrequiredUnique identifier for the image within the page (for example `img-0`).
typestringrequiredA table content block.
tableobjectrequiredPayload for a table block.
Show child attributes
A bounding box with pixel coordinates on the source document image.
A bounding box with coordinates in [0, 1] relative to the source page (model coordinates are thousandths of page width/height).
descriptionstringOptional table description when detected.
htmlstringrequiredTable content as HTML.
titlestringOptional table title when detected.
typestringrequiredTable serialization format.
typestringrequiredindexintegerrequiredZero-based page index.
typestringrequiredA parsed page with markdown content.
indexintegerrequiredZero-based page index.
markdownobjectrequiredMarkdown output payload for a parsed page.
Show child attributes
contentstringrequiredPage content as markdown. Images are embedded as ``. Tables are inlined as HTML.
imagesarray of objectImage metadata referenced from `content`.
Show child attributes
typestringrequired{
"finish_reason": "COMPLETE",
"id": "string",
"meta": {
"api_version": {
"is_deprecated": true,
"is_experimental": true,
"version": "string"
},
"billed_units": {
"classifications": 0,
"image_tokens": 0,
"images": 0,
"input_tokens": 0,
"output_tokens": 0,
"pages": 0,
"search_units": 0
},
"cached_tokens": 0,
"tokens": {
"input_tokens": 0,
"output_tokens": 0
},
"warnings": [
"string"
]
},
"pages": [
{
"blocks": [
{
"image": {
"bounding_box": {
"bottom_right_x": 0,
"bottom_right_y": 0,
"top_left_x": 0,
"top_left_y": 0
},
"bounding_box_normalized": {
"bottom_right_x": 0,
"bottom_right_y": 0,
"top_left_x": 0,
"top_left_y": 0
},
"category": "flowchart",
"description": "string",
"id": "string"
},
"type": "image"
}
],
"index": 0,
"type": "blocks"
}
]
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}idstringmessagestring{
"id": "string",
"message": "string"
}