POST /pipelines/words/writing_type

multipart/form-data. Send the page image and the boxes to classify, in the coordinate system of that image. Authentication: X-API-Key: <key> or Authorization: Bearer <key> header.

POST /pipelines/words/writing_type

Request body

The following parameters can be included in the request body:

Parameters

image
file
Required

Page image.

words
string
Required

JSON list of 20,000 words at most. Each word: id, and either bbox_xyxy ([x1, y1, x2, y2]) or polygon (quadrilateral of 4 points).

threshold
number

Handwriting score threshold, from 0 to 1.

Successful response

The following fields are returned in a successful response:

Response fields

words
array<object>
Required

One object per word sent: index (position in the list sent) and handwritten_score (0 to 1).

threshold
number

Threshold applied.

model_slug
string

Model used.

Examples

Code examples for using this endpoint:

curl
curl -X POST https://api-endpoints.alphaedge-ai.com/pipelines/words/writing_type \
  -H "X-API-Key: $ALPHAEDGE_API_KEY" \
  -F "image=@page1.png" \
  -F 'words=[{"id":0,"bbox_xyxy":[40,30,160,60]},{"id":1,"bbox_xyxy":[180,30,300,60]}]' \
  -F "threshold=0.5"

Response

Sample API response:

json
{
  "ok": true,
  "model_slug": "alpha-digit-fast",
  "threshold": 0.5,
  "words": [
    { "index": 0, "handwritten_score": 0.04 },
    { "index": 1, "handwritten_score": 0.93 }
  ]
}

Good to know

A word is considered handwritten when its handwritten_score reaches or exceeds the threshold. The 20,000-word limit is announced in words_writing_type of GET /pipelines/capabilities.