> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deepface.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Verify whether two images match



## OpenAPI

````yaml /openapi/deepface.openapi.yaml post /verify
openapi: 3.1.0
info:
  title: deepface.dev API
  version: v1
  summary: Managed API for face verification, embeddings, and vector comparison.
  description: >
    Canonical OpenAPI contract for the public deepface.dev gateway. This covers
    the public surface: health, capabilities, verify, represent, and compare.
  license:
    name: Proprietary
    url: https://deepface.dev/terms
servers:
  - url: https://api.deepface.dev
    description: Production gateway
security:
  - BearerAuth: []
  - ApiKeyHeader: []
tags:
  - name: Service
    description: Read-only service metadata and health routes.
  - name: Compute
    description: Authenticated face verification and vector-comparison endpoints.
paths:
  /verify:
    post:
      tags:
        - Compute
      summary: Verify whether two images match
      operationId: verifyFaces
      parameters:
        - $ref: '#/components/parameters/RequestId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyJsonRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VerifyMultipartRequest'
      responses:
        '200':
          description: Verification result
          headers:
            x-request-id:
              $ref: '#/components/headers/RequestId'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimitLimit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimitRemaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimitReset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '422':
          $ref: '#/components/responses/NoFaceDetected'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/UpstreamError'
        '503':
          $ref: '#/components/responses/TemporaryCapacityError'
components:
  parameters:
    RequestId:
      in: header
      name: x-request-id
      required: false
      description: Optional UUID used for request tracing.
      schema:
        type: string
        format: uuid
  schemas:
    VerifyJsonRequest:
      allOf:
        - $ref: '#/components/schemas/CommonImageOptions'
        - type: object
          required:
            - img1
            - img2
          properties:
            img1:
              $ref: '#/components/schemas/ImageDataString'
            img2:
              $ref: '#/components/schemas/ImageDataString'
            distance_metric:
              type: string
              enum:
                - cosine
                - euclidean
                - euclidean_l2
              example: cosine
    VerifyMultipartRequest:
      allOf:
        - $ref: '#/components/schemas/CommonImageOptions'
        - type: object
          required:
            - img1
            - img2
          properties:
            img1:
              type: string
              format: binary
            img2:
              type: string
              format: binary
            distance_metric:
              type: string
              enum:
                - cosine
                - euclidean
                - euclidean_l2
    VerifyResponse:
      type: object
      required:
        - verified
        - distance
        - threshold
      properties:
        verified:
          type: boolean
        distance:
          type: number
        threshold:
          type: number
        model:
          type: string
        facial_areas:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FacialArea'
        time:
          type: number
      additionalProperties: true
    CommonImageOptions:
      type: object
      properties:
        model_name:
          type: string
          maxLength: 200
          description: >
            Approved model name from the current allowlist. For `/verify` and
            `/represent`, omitted, blank, or overlong values are treated as
            absent and the gateway injects the active default model.
          example: Facenet
        detector_backend:
          type: string
          description: >
            Optional detector backend from the current allowlist. When the
            active detector misses a face, the service may retry configured
            fallback detectors before returning `no_face_detected`.
          example: opencv
        enforce_detection:
          type: boolean
          default: true
        align:
          type: boolean
          default: true
        normalization:
          type: string
          description: Optional DeepFace normalization mode.
    ImageDataString:
      type: string
      description: >
        Base64 image payload or data URL. The managed API rejects images that
        exceed the active byte, request-size, or decoded pixel safety limits
        before forwarding work to the model runtime.
    FacialArea:
      type: object
      additionalProperties: true
      properties:
        x:
          type: integer
        'y':
          type: integer
        w:
          type: integer
        h:
          type: integer
    ErrorResponse:
      type: object
      description: >
        Gateway errors include `upstream_response_too_large` when the model
        response exceeds the configured gateway response-size limit.
      required:
        - error
      properties:
        error:
          type: string
        detail:
          type: string
  headers:
    RequestId:
      description: Request identifier echoed by the gateway.
      schema:
        type: string
        format: uuid
    RateLimitLimit:
      description: >-
        Maximum number of compute requests allowed per minute for the current
        account.
      schema:
        type: integer
    RateLimitRemaining:
      description: Remaining compute requests in the current rolling minute window.
      schema:
        type: integer
    RateLimitReset:
      description: Seconds until the current rate-limit window resets.
      schema:
        type: integer
  responses:
    BadRequest:
      description: >
        Invalid request payload, including malformed image data or image inputs
        that exceed the active byte or pixel safety limits.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: >-
        Missing or invalid API key. If the bearer value is an unexpanded shell
        variable, the response detail explains how to quote the header.
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PaymentRequired:
      description: Account does not meet the current credit policy
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NoFaceDetected:
      description: No usable face could be extracted from one of the provided images
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Per-account rate limit exceeded
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Unhandled server error
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UpstreamError:
      description: Model server request failed
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TemporaryCapacityError:
      description: >-
        Temporary billing-reservation, queue, concurrency, or model-tier
        availability pressure
      headers:
        x-request-id:
          $ref: '#/components/headers/RequestId'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimitLimit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimitRemaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimitReset'
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: Use your API key as a bearer token.
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Alternative header for API key authentication.

````