> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fastino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use https://docs.fastino.ai/llms.txt to discover and navigate pages. Use https://docs.fastino.ai/llms-full.txt when you need the complete documentation corpus. Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing routes. For GLiDE decision inference, call POST https://api.fastino.ai/v1/systemone with model fastino/GLiDE. Do not infer undocumented routes. Read API keys from FASTINO_API_KEY and never embed credentials in code, logs, or reports.

# Native GLiNER-2 inference

> Run synchronous native GLiNER-2 extraction and classification with the unified GLiNER schema, with entity extraction and classification examples.

`POST /v1/gliner-2`

Run synchronous native GLiNER-2 extraction and classification. The OpenAPI panel on this
page is the source of truth for every request field and response field.

Use `POST /v1/chat/completions` when you need a named hosted model, a fine-tuned model,
inference persistence, or the OpenAI-compatible envelope. This native endpoint selects the
Fastino GLiNER-2 base model for you.

## Request schema

The request requires:

* `text`: one string or an array of strings.
* `schema`: the unified GLiNER schema dictionary. The legacy flat label array is deprecated.

It also accepts `threshold`, `include_confidence`, `include_spans`, and `format_results`.
Omit `task`; it is a deprecated legacy hint and the schema identifies the operation.

## Entity extraction example

```bash theme={null}
curl -X POST "https://api.fastino.ai/v1/gliner-2" \
  -H "X-API-Key: $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Apple CEO Tim Cook introduced the iPhone in Cupertino.",
    "schema": {
      "entities": [
        {"name": "person", "description": "named individual"},
        {"name": "organization", "description": "business or institution"},
        {"name": "product", "description": "named commercial product"},
        {"name": "location", "description": "city, region, or place"}
      ]
    },
    "threshold": 0.5,
    "include_confidence": true,
    "include_spans": true
  }'
```

## Classification example

```bash theme={null}
curl -X POST "https://api.fastino.ai/v1/gliner-2" \
  -H "X-API-Key: $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "The replacement arrived quickly and works perfectly.",
    "schema": {
      "classifications": [
        {
          "task": "sentiment",
          "labels": ["positive", "negative", "neutral"],
          "multi_label": false,
          "top_k": 1
        }
      ]
    }
  }'
```

Each classic classification requires at least two labels. For every supported entity,
classification, structure, relation, record, attribute, and constrained-classification
shape, use the complete
[`POST /v1/chat/completions` GLiNER schema reference](/api-reference/inference/chat-completions).

## Response schema

A successful response contains:

* `result`: the schema-shaped extraction or classification result.
* `token_usage`: the number of input tokens processed.

```json theme={null}
{
  "result": {
    "entities": [
      {
        "text": "Apple",
        "label": "organization",
        "score": 0.99,
        "start": 0,
        "end": 5
      }
    ]
  },
  "token_usage": 10
}
```

When `text` is an array, `result` is an array in the same input order. Do not send that
batch shape through `POST /v1/chat/completions`; submit those conversations separately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.