OCR
Read PDFs and images with EU-hosted OCR models through the EUrouter API and get the text of every page back as markdown.
Read a document with OCR
Extract the text of a PDF or an image as markdown, page by page, with an EU-hosted OCR model. Send the document as an https URL or a base64 data URL. The request and response follow the Mistral OCR API, plus the EUrouter provider preferences and the cost in usage. Billed per page read. Annotation options and uploaded files (file_id) are not supported, and neither is streaming.
Authentication: Requires an API key.
Authorization
apiKey API key used for model requests. Format: eur_<public-id>.<secret>.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://api.eurouter.ai/api/v1/ocr" \ -H "Content-Type: application/json" \ -d '{ "model": "string", "document": { "document_url": "string" } }'{
"id": "string",
"model": "string",
"provider": "string",
"pages": [
{
"index": -9007199254740991,
"markdown": "string",
"images": [
{
"id": "string",
"top_left_x": 0,
"top_left_y": 0,
"bottom_right_x": 0,
"bottom_right_y": 0,
"image_base64": "string",
"property1": null,
"property2": null
}
],
"tables": [
{
"id": "string",
"content": "string",
"format": "string",
"property1": null,
"property2": null
}
],
"hyperlinks": [
"string"
],
"header": "string",
"footer": "string",
"dimensions": {
"dpi": 0,
"height": 0,
"width": 0,
"property1": null,
"property2": null
},
"confidence_scores": null,
"blocks": [
null
],
"property1": null,
"property2": null
}
],
"usage_info": {
"pages_processed": -9007199254740991,
"doc_size_bytes": -9007199254740991
},
"usage": {
"cost": 0,
"cost_currency": "USD",
"cost_eur": 0
}
}{
"error": {
"code": 403,
"message": "string",
"type": "permission_error",
"param": null,
"details": {
"reason": "string",
"reasons": [
{
"code": "string",
"layer": "org"
}
]
}
},
"requestId": "string"
}