LocalAI Face Recognition API

The face-recognition API from LocalAI — 6 operation(s) for face-recognition.

Operations 6

POST /v1/face/analyze Analyze demographic attributes (age, gender, ...) of faces.
POST /v1/face/embed Extract a face embedding from an image.
POST /v1/face/forget Remove a previously-registered face by ID.
POST /v1/face/identify Identify a face against the registered database (1:N recognition).
POST /v1/face/register Register a face for 1:N identification.
POST /v1/face/verify Verify that two images depict the same person.

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-face-recognition-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 email required.

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

OpenAPI Specification

localai-face-recognition-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: The LocalAI Rest API.
  title: LocalAI Face Recognition 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: face-recognition
paths:
  /v1/face/analyze:
    post:
      tags:
      - face-recognition
      summary: Analyze demographic attributes (age, gender, ...) of faces.
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schema.FaceAnalyzeResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.FaceAnalyzeRequest'
        description: query params
        required: true
  /v1/face/embed:
    post:
      tags:
      - face-recognition
      summary: Extract a face embedding from an image.
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schema.FaceEmbedResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.FaceEmbedRequest'
        description: query params
        required: true
  /v1/face/forget:
    post:
      tags:
      - face-recognition
      summary: Remove a previously-registered face by ID.
      responses:
        '204':
          description: No Content
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.FaceForgetRequest'
        description: query params
        required: true
  /v1/face/identify:
    post:
      tags:
      - face-recognition
      summary: Identify a face against the registered database (1:N recognition).
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schema.FaceIdentifyResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.FaceIdentifyRequest'
        description: query params
        required: true
  /v1/face/register:
    post:
      tags:
      - face-recognition
      summary: Register a face for 1:N identification.
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schema.FaceRegisterResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.FaceRegisterRequest'
        description: query params
        required: true
  /v1/face/verify:
    post:
      tags:
      - face-recognition
      summary: Verify that two images depict the same person.
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/schema.FaceVerifyResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/schema.FaceVerifyRequest'
        description: query params
        required: true
components:
  schemas:
    schema.FaceIdentifyResponse:
      type: object
      properties:
        matches:
          type: array
          items:
            $ref: '#/components/schemas/schema.FaceIdentifyMatch'
    schema.FaceRegisterRequest:
      type: object
      properties:
        img:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        model:
          type: string
        name:
          type: string
        store:
          description: vector store model; empty = local-store default
          type: string
    schema.FaceAnalysis:
      type: object
      properties:
        age:
          type: number
        antispoof_score:
          type: number
        dominant_emotion:
          type: string
        dominant_gender:
          type: string
        dominant_race:
          type: string
        emotion:
          type: object
          additionalProperties:
            type: number
            format: float32
        face_confidence:
          type: number
        gender:
          type: object
          additionalProperties:
            type: number
            format: float32
        is_real:
          description: Liveness fields — see FaceVerifyResponse for why these are pointers.
          type: boolean
        race:
          type: object
          additionalProperties:
            type: number
            format: float32
        region:
          $ref: '#/components/schemas/schema.FacialArea'
    schema.FaceEmbedRequest:
      type: object
      properties:
        img:
          type: string
        model:
          type: string
    schema.FacialArea:
      type: object
      properties:
        h:
          type: number
        w:
          type: number
        x:
          type: number
        y:
          type: number
    schema.FaceForgetRequest:
      type: object
      properties:
        id:
          type: string
        model:
          type: string
        store:
          type: string
    schema.FaceVerifyRequest:
      type: object
      properties:
        anti_spoofing:
          type: boolean
        img1:
          type: string
        img2:
          type: string
        model:
          type: string
        threshold:
          type: number
    schema.FaceAnalyzeRequest:
      type: object
      properties:
        actions:
          description: subset of {"age","gender","emotion","race"}
          type: array
          items:
            type: string
        anti_spoofing:
          type: boolean
        img:
          type: string
        model:
          type: string
    schema.FaceIdentifyMatch:
      type: object
      properties:
        confidence:
          type: number
        distance:
          type: number
        id:
          type: string
        labels:
          type: object
          additionalProperties:
            type: string
        match:
          description: true when distance <= threshold
          type: boolean
        name:
          type: string
    schema.FaceVerifyResponse:
      type: object
      properties:
        confidence:
          type: number
        distance:
          type: number
        img1_antispoof_score:
          type: number
        img1_area:
          $ref: '#/components/schemas/schema.FacialArea'
        img1_is_real:
          description: 'Liveness fields are only populated when the request set

            anti_spoofing=true. Pointers keep them fully absent from the

            JSON response otherwise, so callers can tell "not checked"

            apart from "checked and fake" (which would collapse to zero

            values with plain bool+omitempty).'
          type: boolean
        img2_antispoof_score:
          type: number
        img2_area:
          $ref: '#/components/schemas/schema.FacialArea'
        img2_is_real:
          type: boolean
        model:
          type: string
        processing_time_ms:
          type: number
        threshold:
          type: number
        verified:
          type: boolean
    schema.FaceEmbedResponse:
      type: object
      properties:
        dim:
          type: integer
        embedding:
          type: array
          items:
            type: number
        model:
          type: string
    schema.FaceAnalyzeResponse:
      type: object
      properties:
        faces:
          type: array
          items:
            $ref: '#/components/schemas/schema.FaceAnalysis'
    schema.FaceRegisterResponse:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        registered_at:
          type: string
    schema.FaceIdentifyRequest:
      type: object
      properties:
        img:
          type: string
        model:
          type: string
        store:
          type: string
        threshold:
          description: optional cutoff on distance
          type: number
        top_k:
          type: integer
  securitySchemes:
    BearerAuth:
      type: apiKey
      name: Authorization
      in: header