Quickstart

Make your first call with a test key: compare two faces with face.verify. You need a VeriSec account and about five minutes.

  1. Create a test key

    On verisec.dev, open API keys and create a key. Test keys start with sk_test_. The secret is shown once, so store it straight away, in an environment variable rather than in your code:

    Terminal
    export VERISEC_API_KEY=sk_test_…
  2. Install a library

    Pick your language, or skip this step and use cURL.

    # cURL needs nothing extra.
    curl --version
  3. Create a client

    Every library reads VERISEC_API_KEY from the environment when you don't pass a key.

    # cURL sends the key on every request:
    #   -H "Authorization: Bearer $VERISEC_API_KEY"
  4. Compare two faces

    face.verify answers whether two photos show the same person. The libraries take a file path for each image and send it for you; with cURL you send the image as base64.

    Request
    curl -X POST https://verisec.dev/v1/face/verify \
      -H "Authorization: Bearer $VERISEC_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "image1": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
        "image2": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==",
        "threshold": 0.75
      }'
  5. Read the answer

    KYC answers share one envelope. data is the result; request_id is what you quote if you contact us.

    Response
    {
      "ok": true,
      "request_id": "req_cd1d47ea5bf34b7aae6c",
      "latency_ms": 2362,
      "data": {
        "code": 0,
        "msg": "OK",
        "similarity": 0.9983906745910645,
        "score": 0.23992152512073517,
        "match": true,
        "threshold": 0.75,
        "compared": [
          {
            "image": "image1",
            "roi": [
              182,
              241,
              173,
              220
            ]
          },
          {
            "image": "image2",
            "roi": [
              940,
              245,
              176,
              216
            ]
          }
        ],
        "elapsedTime": 2.299846035,
        "metadata": {
          "serverTime": "2026-10-05T05:35:01.160Z",
          "ctx": {
            "userIp": "203.0.113.7"
          }
        }
      },
      "warnings": [],
      "error": null
    }

    match is the decision at the threshold you sent (0.75 when you leave it out), and similarity is the score behind it.

Next steps#