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

# Gliner2 Async

`POST /gliner-2/async`

Submit large GLiNER-2 request for async processing.

Use this endpoint when processing >1M tokens that would exceed
the 30-second timeout. Returns immediately with a job_id.
Poll GET /gliner-2/jobs/{job_id} to retrieve results.

Args:
    request: AsyncGlinerRequest with task, text, schema
    http_request: FastAPI request object
    auth: Authentication result

Returns:
    202 Accepted with job_id for polling

## Request body

- AsyncGlinerRequest — Request for async GLiNER-2 processing.
  - `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 `202`

Successful Response

- AsyncGlinerResponse — Response from async job submission.
  - `job_id` string, required
  - `status` string, required
  - `estimated_tokens` integer, required
  - `message` string, 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)
