POST multipart/form-data : champ fichier obligatoire nommé exactement image (pas file). model_slug dans le chemin : alpha-digit-max, alpha-digit-fast ou alpha-digit-handwritten. Optionnel : pdf_password (chaîne) pour un PDF protégé. Option avancée (booléen en chaîne true/false ou 1/0) : enable_bbox pour les boîtes englobantes (layout / regions). Tout autre nom de champ interdit ; pas de champ model dans le formulaire → HTTP 422 si non conforme. Ne pas fixer Content-Type manuellement : multipart/form-data et boundary générés par le client.
/models/{model_slug}/ocr
Request body
The following parameters can be included in the request body:
Parameters
image
Image or PDF file to analyze (multipart/form-data, exact name: image).
pdf_password
Optional. Password for a protected PDF.
enable_bbox
false
Optionnel. Active le retour des bounding boxes (régions / layout) pour localiser chaque bloc de texte sur la page. Valeurs acceptées : true, false, 1, 0. Non facturé.
Successful response
The following fields are returned in a successful response:
Response fields
model_slug
Slug of the model used for inference.
text
Text extracted from the image.
inference_seconds
Inference time in seconds.
global_confidence
Global confidence score (0–1), or null if not applicable.
words
List of detected words with their individual confidence score.
page_size
Dimensions de la page (width, height) dans le repère des bounding boxes. Présent notamment lorsque enable_bbox=true.
layout
Présent si enable_bbox=true. Contient regions[] : blocs de texte avec coordonnées bbox_xyxy [x_min, y_min, x_max, y_max], label et confidence.
image_filename
Name of the provided file, or null.
Examples
Code examples for using this endpoint:
curl -X POST "https://api-endpoints.alphaedge-ai.com/models/alpha-digit-max/ocr" \
-H "X-API-Key: TA_CLE" \
-F "image=@/chemin/facture.png" \
-F "enable_bbox=true"
import requests
url = "https://api-endpoints.alphaedge-ai.com/models/alpha-digit-max/ocr"
headers = {"X-API-Key": "TA_CLE"}
with open("/chemin/facture.png", "rb") as f:
files = {"image": ("facture.png", f, "image/png")}
data = {
"enable_bbox": "true",
}
r = requests.post(url, headers=headers, files=files, data=data, timeout=300)
print(r.status_code)
print(r.json())
import fs from "node:fs";
const form = new FormData();
form.append("image", new Blob([fs.readFileSync("/chemin/facture.png")]), "facture.png");
form.append("enable_bbox", "true");
const res = await fetch("https://api-endpoints.alphaedge-ai.com/models/alpha-digit-max/ocr", {
method: "POST",
headers: { "X-API-Key": "TA_CLE" },
body: form
});
console.log(res.status, await res.json());
Response
Sample API response:
{
"model_slug": "alpha-digit-max",
"text": "Facture n° 2026-0042\nMontant TTC 123,45 EUR",
"inference_seconds": 0.42,
"global_confidence": 0.91,
"words": [
{ "w": "Facture", "confidence": 0.99 },
{ "w": "n°", "confidence": 0.95 },
{ "w": "2026-0042", "confidence": 0.98 }
],
"page_size": { "width": 1240, "height": 1754 },
"layout": {
"regions": [
{
"text": "Facture n° 2026-0042",
"label": "title",
"confidence": 0.97,
"bbox_xyxy": [80, 120, 620, 168]
},
{
"text": "Montant TTC 123,45 EUR",
"label": "text",
"confidence": 0.94,
"bbox_xyxy": [80, 980, 540, 1024]
}
]
},
"image_filename": "facture.png"
}