LocalAI Pii API

The pii API from LocalAI — 2 operation(s) for pii.

Operations 2

POST /api/pii/analyze Detect PII entities in a string (no mutation) #
POST /api/pii/redact Redact PII in a string by applying the configured policy #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/localai-pii-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

localai-pii-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: The LocalAI Rest API.
  title: LocalAI Pii API
  contact:
    name: LocalAI
    url: https://localai.io
  license:
    name: MIT
    url: https://raw.githubusercontent.com/mudler/LocalAI/master/LICENSE
  version: 2.0.0
servers:
- url: /
tags:
- name: pii
paths:
  /api/pii/analyze:
    post:
      description: 'Runs the configured PII detectors (NER and/or pattern tiers) over the supplied text and returns the matched entity spans with the policy action that would fire. Detection only — the text is not modified and no block is enforced. Select detectors explicitly via `detectors`, or pass a consuming `model` to use its effective policy: the model''s own `pii.detectors`, else the instance-wide `pii_default_detectors`. A model with PII disabled, or enabled with nothing to scan with, is a 400. The raw matched value is never returned; admins may set `reveal:true` for the audit hash prefix.'
      tags:
      - pii
      summary: Detect PII entities in a string (no mutation)
      responses:
        '200':
          description: Detected entities
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schema.PIIAnalyzeResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.PIIAnalyzeRequest'
        description: text + detector selection
        required: true
      operationId: postApiPiiAnalyze
      x-operation-id-source: derived
  /api/pii/redact:
    post:
      description: 'Runs the configured PII detectors over the text and applies each detector model''s policy: masked spans are replaced with `[REDACTED:]`, allow spans pass through, and a single block action causes a 400 (type `pii_blocked`) carrying the offending entities — the text is never returned in that case. Select detectors via `detectors`, or a consuming `model`''s effective policy (its own `pii.detectors`, else the instance-wide `pii_default_detectors`; PII must be enabled on the model). Records audit events (origin `pii_redact`) visible at /api/pii/events.'
      tags:
      - pii
      summary: Redact PII in a string by applying the configured policy
      responses:
        '200':
          description: Redacted text + entities
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schema.PIIRedactResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.PIIAnalyzeRequest'
        description: text + detector selection
        required: true
      operationId: postApiPiiRedact
      x-operation-id-source: derived
components:
  schemas:
    schema.PIIRedactResponse:
      type: object
      properties:
        blocked:
          type: boolean
        correlation_id:
          type: string
        entities:
          type: array
          items:
            $ref: '#/components/schemas/schema.PIIEntity'
        masked:
          type: boolean
        redacted_text:
          type: string
    schema.PIIEntity:
      type: object
      properties:
        action:
          type: string
        end:
          type: integer
        entity_type:
          type: string
        hash_prefix:
          type: string
        score:
          type: number
        source:
          type: string
        start:
          type: integer
    schema.PIIAnalyzeRequest:
      type: object
      properties:
        detectors:
          description: 'Detectors names the detector models to run (NER and/or pattern). Takes

            precedence over Model.'
          type: array
          items:
            type: string
        model:
          description: 'Model is a consuming model whose effective PII policy (own

            pii.detectors, else the instance default detectors; PII must be

            enabled) is used when Detectors is empty.'
          type: string
        reveal:
          description: 'Reveal includes the per-entity hash_prefix in the response. Honoured

            only for admin callers; ignored otherwise. The raw matched value is

            never returned regardless.'
          type: boolean
        text:
          description: 'Text is the string to scan. Bounded only by the server''s global HTTP

            body limit.'
          type: string
    schema.PIIAnalyzeResponse:
      type: object
      properties:
        blocked:
          type: boolean
        correlation_id:
          type: string
        entities:
          type: array
          items:
            $ref: '#/components/schemas/schema.PIIEntity'
  securitySchemes:
    BearerAuth:
      type: apiKey
      name: Authorization
      in: header