Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.zerogpu.ai/llms.txt

Use this file to discover all available pages before exploring further.

Use extraction models to turn free-form text into structured JSON or labeled spans. For example: contact blocks from email signatures, technologies from product descriptions, or PII from user-submitted content. ZeroGPU routes these requests through the Responses API. Pass model-specific options in the metadata object (usecase, schema, labels, and related fields).

Structured field extraction

Use gliner2-base-v1 with metadata.usecase set to json and a schema that describes the fields you want. Each field uses the form name::type::description.

Request

curl --location 'https://api.zerogpu.ai/v1/responses' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-project-id: YOUR_PROJECT_ID' \
  --data '{
    "model": "gliner2-base-v1",
    "input": "Best regards, John Smith, Senior Software Engineer at Acme Corp. Phone: (555) 123-4567, Email: [email protected], Office: 123 Main Street, Suite 400, San Francisco, CA 94105",
    "metadata": {
      "usecase": "json",
      "schema": {
        "contact": [
          "name::str::Full name",
          "title::str::Job title",
          "company::str::Company name",
          "phone::str::Phone number",
          "email::str::Email address",
          "address::str::Office address"
        ]
      }
    }
  }'

Response

The model returns JSON in output[].content[].text. The shape follows your schema. For example, a contact object with the fields you defined. Parse that string with json.loads (Python) or JSON.parse (JavaScript) before passing it to your app.

Named entity extraction

For open-ended labels (not a fixed field list), use the same model with metadata.usecase set to ner and a labels array:
curl --location 'https://api.zerogpu.ai/v1/responses' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-project-id: YOUR_PROJECT_ID' \
  --data '{
    "model": "gliner2-base-v1",
    "input": "The application is built with Python 3.11 and uses PostgreSQL 15 for storage. It runs on Kubernetes with Docker containers and communicates via gRPC.",
    "metadata": {
      "usecase": "ner",
      "labels": ["programming language", "database", "technology", "protocol"],
      "threshold": 0.3
    }
  }'
The response includes entity spans with labels and confidence scores. Adjust threshold to trade off precision and recall.

PII extraction

For personally identifiable information, use gliner-multi-pii-v1 with metadata.usecase set to extract-pii:
curl --location 'https://api.zerogpu.ai/v1/responses' \
  --header 'content-type: application/json' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'x-project-id: YOUR_PROJECT_ID' \
  --data '{
    "model": "gliner-multi-pii-v1",
    "input": "Contact John Doe at [email protected] or +1-415-555-0134.",
    "metadata": {
      "usecase": "extract-pii",
      "threshold": 0.5,
      "categories": ["identity", "contact"]
    }
  }'
To redact PII instead of returning spans, use metadata.usecase redact with mask set to label or another supported mask mode. See the gliner-multi-pii-v1 model page for use-case details.

Tips

  • input shape: GLiNER models accept a plain string for input (as above). Other models may expect a message array. See Responses.
  • Schema design: Use clear field descriptions in name::type::description; they guide what the model extracts.
  • Batch workloads: Extract many documents with batch patterns (parallel requests, per-item error handling).
  • Try interactively: Open gliner2-base-v1 or gliner-multi-pii-v1 in the model catalog and use the playground to switch use cases and edit the request body.
  • Full walkthrough: See the resume & profile extraction tutorial with a synthetic dataset and batch script.