Skip to content

Information Extraction (Extract)

Pulling people, companies, dates or amounts out of a text, or sorting a text into labels you defined up front, does not require prompting a chat model and parsing what it writes back. Models on the /v1/extract endpoint take the text and a schema describing what to extract, and return the result as JSON in a single pass. By default, every piece of text pulled from the input comes with a confidence and its character position, and every classification with a confidence.

These models do not generate text or hold a conversation. If you need a free-form answer, use Chat Completions.

Model Context Input / Output ($/1M tokens)
fastino/gliner2.5-multi-v1 4,096 0.03 / 0

fastino/gliner2.5-multi-v1 is multilingual; it works with Turkish text and Turkish label names as well as English.

To list the extraction models in the catalog:

Terminal window
curl -s "$LLMTR_BASE_URL/v1/models" \
| jq -r '.data[] | select(.supported_operations[] == "EXTRACTION").id'
Terminal window
curl "$LLMTR_BASE_URL/v1/extract" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "fastino/gliner2.5-multi-v1",
"text": "Turkcell CEO Ali Taha Koc presented the new 5G package at a press event in Istanbul for 299 TL.",
"schema": {
"entities": [
{ "name": "person", "description": "person name" },
{ "name": "company", "description": "company name" },
"city"
],
"classifications": [
{ "task": "sentiment", "labels": ["positive", "negative", "neutral"] }
]
},
"threshold": 0.5
}'
Field Required Description
model Yes The extraction model's id.
text Yes The text to analyse.
schema Yes What to extract. At least one of the entities, classifications, structures and relations keys.
threshold No Confidence threshold between 0 and 1, default 0.5. Lower values return more results, higher values fewer but more certain ones.
include_confidence No Default true. With false, confidence values are omitted.
include_spans No Default true. With false, start / end positions are omitted.
max_budget_usd No Pre-request cost check; if the estimated cost exceeds this value the request is refused before it is sent.

Keys other than the fields in this table are rejected with 400 invalid_request.

The four task kinds can be combined in one request; the model runs all of them over the same text in a single pass.

A list of label names. Adding a description improves results, especially for generically named labels.

{
"entities": [
{ "name": "company", "description": "business or institution name" },
{ "name": "product", "description": "named commercial product" },
"city"
]
}

Each task has a name (task) and the labels to choose from (labels). multi_label: true allows more than one label to be selected, and top_k limits how many labels are returned.

{
"classifications": [
{ "task": "sentiment", "labels": ["positive", "negative", "neutral"] },
{ "task": "aspects", "labels": ["battery", "screen", "price", "shipping"], "multi_label": true, "top_k": 2 }
]
}

Extracts typed records from the text. Each field is written as name::type::description; the type is str or list.

{
"structures": {
"announcement": [
"product::str::product being announced",
"price::str::stated price",
"date::str::announcement date"
]
}
}

A list of relation names, or an object that gives each name a description and a threshold. Do not put head or tail entities in the relation definition; the model finds both in the text.

{
"relations": ["works_for", "located_in"]
}
{
"relations": {
"works_for": { "description": "employment relationship", "threshold": 0.6 }
}
}
{
"object": "extraction",
"model": "fastino/gliner2.5-multi-v1",
"result": {
"entities": {
"person": [{ "text": "Ali Taha Koc", "confidence": 1, "start": 13, "end": 25 }],
"company": [{ "text": "Turkcell", "confidence": 0.99609375, "start": 0, "end": 8 }],
"city": [{ "text": "Istanbul", "confidence": 1, "start": 75, "end": 83 }]
},
"sentiment": { "label": "positive", "confidence": 0.80859375 }
},
"usage": { "input_tokens": 27, "output_tokens": 120 }
}

The keys inside result come from your schema:

In the schema In result
entities under entities, one list per label name
classifications at the top level under the task name; { "label", "confidence" }, or a list of those with multi_label
structures at the top level under the structure name, a list of records keyed by field name
relations under relation_extraction, one list of { "head", "tail" } pairs per relation name

start and end are a half-open character range in the text you sent: start included, end excluded.

An entity label with no match comes back as an empty list. A structure with no match may be left out of the response altogether; do not assume the key is present.

With include_spans: false, entities carry no positions and each distinct text is listed once. If include_confidence is also false, entities come back as plain lists of strings and classifications as a single label string.

The model field returns the LLMTR catalog id.

Only input tokens are charged, and the billed count is the usage.input_tokens value in the response. output_tokens is usually above zero but free; do not assume it is zero when you build your own token accounting.

No platform margin is added to model prices; the margin applies only to credit top-ups. See Billing for details.

Text and schema together are limited to 4,096 tokens per request. A request over the limit is not truncated; it is rejected with 400 invalid_request, and the message states how many tokens the request was. Split long documents and send each part as its own request; start / end are relative to the part you sent, so add the part's starting offset to get the position in the whole document.

Each request processes one text. Send multiple texts as separate concurrent requests.

If the model has not been called for a while, the first response can be noticeably delayed. Keep your client timeout at 300 seconds or more.

Request content is not retained by the model provider. Retention fields such as store are therefore not accepted.

This endpoint does not support streaming. Extraction models do not appear in the Playground and cannot be called on the chat endpoints; fastino/gliner2.5-multi-v1 answers only on /v1/extract.

Status Meaning
400 invalid_request The request body does not match the schema, or text and schema together exceed the token limit. The message says which.
404 model_not_found The model id is not in the catalog.
400 unsupported_operation The model does not support this endpoint. The response lists the endpoints the model does support.
422 invalid_request The model did not accept a field value. The message names the field.
429 rate_limit_error The API key's request limit was exceeded.
503 model_unavailable The model is temporarily unable to respond. If the response carries a Retry-After header, wait that long and retry.

See Errors for the error format.