GLiNER-2
Run Inference
Perform fast, schema-driven entity extraction, text classification, and structured data parsing through the hosted GLiNER 2 inference engine.
POST /gliner-2
Purpose
Use this endpoint to run Named Entity Recognition, Text Classification, or Structured Data Extraction without setting up local models.
GLiNER 2 unifies multiple information-extraction tasks in a single efficient forward pass optimized for CPU-based inference.
Typical use-cases include:
Extracting entities such as people, organizations, products, or places
Classifying text for sentiment, topic, or intent
Parsing structured fields from unstructured text such as invoices, contracts, or medical records
Endpoint
POST https://api.fastino.ai/gliner-2
Headers
Request Body
Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The input text to analyze. |
labels | object / list | Yes | Entity labels, class labels, or structured-field schema depending on task type. |
threshold | float | Optional | Confidence threshold for predictions (default = 0.5). |
task | string | Optional | Optional task specifier (e.g. |
schema | object | Optional | Schema definition for structured extraction (required if using |
Example 1 – Entity Extraction
Example Response
Example 2 – Text Classification
Example Response
Example 3 – Structured Extraction
Example Response
Example cURL
Response Fields
Field | Type | Description |
|---|---|---|
entities | object | Map of detected entity labels to extracted text spans. |
classification | object / string | For classification tasks, the predicted label(s). |
structured_output | object | For structured extraction, key–value pairs following the provided schema. |
Error Responses
HTTP Code | Error Code | Description |
|---|---|---|
400 |
| Missing or malformed fields. |
401 |
| Invalid or missing API key. |
500 |
| Internal inference error — retry with exponential backoff. |
Example:
Best Practices
Keep
textunder 8 KB per call for optimal latency.Reuse the same model session for batch requests to leverage warm caching.
Use
threshold ≥ 0.7for precision-critical domains such as finance or healthcare.Combine GLiNER 2 output with the Fastino Personalization API to enable user-specific extraction or context enrichment.
Summary
POST /gliner-2 provides unified, production-ready information extraction through Fastino’s hosted GLiNER 2 engine — efficient, accurate, and fully compatible with LLM pipelines.
Join our Discord Community