Skip to main content
Fastino provides two synchronous interfaces for GLiNER inference. Choose the interface that matches your model and payload requirements:
Start with /v1/chat/completions for a consistent API across base and fine-tuned models. Use /v1/gliner-2 when you specifically need the fixed GLiNER2 base model’s native contract, batch input, or asynchronous processing.
This page documents the raw /v1/chat/completions HTTP contract below. The native /v1/gliner-2 schemas are published in the OpenAPI document. SDK usage, model training, evaluation, inference history, and feedback are outside this page’s scope.
POST /inference has been removed. Do not send its legacy fields such as model_id, text, task, format_results, or is_warmup.

Endpoint

Authentication

Send a Fastino API key as a bearer token:

Request

string
required
An inference-capable base-model ID or the UUID of a completed, deployable Fastino training job.
object[]
required
A non-empty list of messages. For GLiNER inference, put the text to analyze in a user message’s content.
object
Defines custom encoder tasks. Supply a dictionary containing one or more of entities, classifications, structures, or relations. Omit it only when the selected model has a configured default task.A flat array of entity labels is deprecated. Always use the dictionary shape.
number
default:"0.5"
Confidence threshold from 0 to 1. Lower values favor recall; higher values favor precision.
boolean
default:"true"
Include confidence values in extracted results.
boolean
default:"true"
Include half-open character offsets (start, end) in entity results.
boolean
default:"true"
Persist the inference. Set to false to opt out.

Entity schema

Use descriptive entity definitions when possible:

Classification schema

Structured extraction schema

Structure fields use field::type::description specifications:

Relation schema

The simplest relation schema is a flat list of relation names:
You can also use a dictionary to add descriptions or per-relation configuration:
Do not send relation objects containing head and tail definitions.

Combined schema

Run multiple tasks over the same text by combining keys:
The schema identifies the operation automatically. Do not send task or task_type.

Example

The model value must currently support hosted inference. Use the live model catalog rather than assuming every Hugging Face checkpoint is available:

Response

The endpoint returns a chat-completion envelope. The GLiNER result is serialized as a JSON string in choices[0].message.content:
Parse choices[0].message.content as JSON before reading task results. When store=true, x_pioneer.inference_id identifies the persisted inference.

Repeated inputs

The endpoint accepts one conversation per request. It does not support the removed native endpoint’s text: string[] batch shape. Send separate requests concurrently when processing multiple inputs.

Cold starts and retries

An idle or newly deployed model may cold-start. Use a read timeout of at least 300 seconds and retry 425, 429, and 503 responses. Respect the Retry-After response header when present. A timed-out request can still warm the deployment, allowing the next request to succeed. Do not retry authentication, billing, validation, unknown-model, or non-deployable-job errors without correcting the underlying problem.

Errors

Legacy request migration