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

# Gliner2 Process

`POST /v1/gliner-2`

## Request

- Base URL: `https://api.pioneer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pioneer.ai/v1/gliner-2`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/pioneer/apis/brain-api/docs/v1/gliner-2/post.ts> (a function with typed inputs; its response is checked against the schema)

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

## Changes

- **2026-09-24** `0e5e86e2bae5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pioneer/apis/brain-api/changes/v1/gliner-2/post.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) - [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/0e5e86e2bae5?raw)
