Extract named entities from text using a custom-defined schema.
/extract endpoint runs Named Entity Recognition (NER) over a block of text. Unlike standard NER, you define the entity types you want in plain English — the model uses your descriptions to find matching spans, returning each one with a confidence score and surrounding context.
Every result includes up to 500 characters of surrounding text on each side, so you can validate or use the extracted value without going back to the source.
description, threshold, and top_n fields that override the global values for that entity type only0 returns all results above the threshold. Can be overridden per entity type.| Status | Meaning |
|---|---|
400 Bad Request | Malformed request body, missing required fields, or empty entities map. |
401 Unauthorized | Missing or invalid x-api-key. |
429 Too Many Requests | Rate limit exceeded. Back off and retry. |
500 Internal Server Error | Inference service unavailable. |
x-api-key header.
threshold and top_n when different entity types need different precision, or when you only want the single best match for a given type.
Name uses threshold 0.3 and returns at most 1 resultCompany uses threshold 0.7 and returns up to 5 results (global top_n)Email uses the global threshold 0.5 and returns up to 5 resultstop_n is applied.context field is always derived from the original text input — it is not generated by the model.start, end) refer to byte positions in the original text string.