---
title: "Gliner2 Process"
method: POST
path: "/gliner-2"
tags: ["gliner"]
---

# Gliner2 Process

`POST /gliner-2`

Process text using GLiNER-2 base model via InferenceService.

``task`` is optional — when omitted the unified schema path is used.
Legacy task names are still accepted but deprecated.

## Request body

- GlinerRequest — Request for GLiNER-2 processing (sync).
  - `task` string, nullable — **Deprecated** legacy task hint. One of: 'extract_entities', 'classify_text', 'extract_json', 'schema'. Omit for the unified GLiNER2 path. Submitting a legacy task value still succeeds but the response carries ``Deprecation: true`` and a ``Sunset`` header.
  - `text` union, required
    - string
    - string[]
  - `schema` union, required — Extraction schema. The flat ``list[str]`` of entity labels is deprecated; use the unified dict shape (``entities`` / ``classifications`` / ``structures`` / ``relations``) for forward compatibility. Deprecated submissions emit ``Deprecation: true`` and ``Sunset: <RFC 7231 date>`` headers.
    - string[]
    - object
  - `threshold` number, nullable
  - `include_confidence` boolean, nullable
  - `include_spans` boolean, nullable
  - `format_results` boolean, nullable

## Response `200`

Successful Response

- GlinerResponse — Response from GLiNER-2 processing.
  - `result` union, required
    - object
    - unknown[]
      - unknown
  - `token_usage` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/versions/31dfe831e079/schema)
