Skip to main content

Build

Face Recognition

by sightradar-connect

Face recognition with the SightRadar API. Use when the user wants to recognise, match, search, compare, verify or detect faces in photos, build a "find my photos from a selfie" feature, tag people across a photo library, add face search to an app, or pick the right face recognition call and estimate what it costs. Covers setup, API key, pricing, image input, thresholds and errors, and points to the task skills (face-search, face-compare, face-detect, face-batch-indexing, face-data-deletion, rekognition-migration).

  • New
  • v1.0.0
  • Reviewed Dec 5
  • No reviews yet

Capabilities

  • Pick the task

    If the task skill is not installed, the sections below are enough to make any call with curl

  • Cost

    Prepaid credits

  • Images

  • Thresholds

    Scores are cosine similarity from 0 to 1

Getting started

Full instructions

Example command

Setup

curl -s https://api.sightradar.com/v1/wallet -H "Authorization: Bearer $SIGHTRADAR_API_KEY"

Instructions: SKILL.mdv1.0.0

Face recognition with SightRadar

SightRadar is a hosted face recognition REST API at https://api.sightradar.com. Faces are stored as faceprints in collections that you name. Photos are not stored: you keep the image and refer to it by the photoId you pass when indexing.

Docs for agents: https://sightradar.com/llms.txt (add .md to any docs URL). OpenAPI spec: https://api.sightradar.com/openapi.json

Pick the task

The user wants to Call Skill
Find every photo of a person from one selfie index, then search face-search
Check whether two photos show the same person compare face-compare
Count faces, get face boxes, check photo quality detect face-detect
Load thousands of photos batch + webhooks face-batch-indexing
Remove a person's or an event's face data deletes face-data-deletion
Move off AWS Rekognition route mapping rekognition-migration

If the task skill is not installed, the sections below are enough to make any call with curl.

Rules for the agent

  • Billable calls spend the user's money. Say what a run will cost before a loop or a batch, check the balance first, and send an Idempotency-Key on any call you might retry.
  • Refer to the key only as $SIGHTRADAR_API_KEY. Never print it, commit it, or put it in browser or mobile code.
  • Deletes are soft (restorable) by default. Use ?immediate=true or ?compliance=true only when the user asks for permanent erasure.
  • Face data is sensitive personal data. Index or register a person's face only when the user has that person's consent and a clear purpose, and never use face search to identify strangers.
  • A face match shows resemblance, not identity. For identity checks it is one signal next to document and liveness checks.

Setup

  1. Create an account and an API key at https://sightradar.com/dashboard/keys. The key is shown once and looks like frs_<prefix>_<secret>.
  2. Export it and test it with a free call:
bash
export SIGHTRADAR_API_KEY="frs_..."
curl -s https://api.sightradar.com/v1/wallet -H "Authorization: Bearer $SIGHTRADAR_API_KEY"
# {"balance_credits": 500000}

If the key is missing, ask the user to create one and set the variable themselves. Do not ask them to paste it into the chat.

SDKs wrap the same routes: pip install sightradar (Python 3.8+, no dependencies) and npm install sightradar (Node 18+). Both read SIGHTRADAR_API_KEY. For chat assistants there is also an MCP server: npx -y sightradar-mcp, or the hosted one at https://mcp.sightradar.com/mcp.

Cost

Prepaid credits. 1 credit = $0.00001, so 93 credits is about $0.00093 and 1,000 photos indexed in real time cost about $0.93. Current prices: https://sightradar.com/pricing

Operation Credits
Index a photo, search by image, register a selfie, detect 93 per photo
Compare 93 per image (two images = 186)
Search by a stored id, batch (per photo) 62
Collections, deletes, batch status, balance, usage free

The charge is per photo, never per face. A photo with no face is still charged. Requests that fail with 4xx or 5xx are not charged. Billable responses carry an X-Credits-Remaining header.

Images

Index, search, detect and register-selfie take exactly one image per call, sent as one of:

  • JSON {"url": "https://..."}: a public URL the API can fetch
  • multipart form with a file part: a local file
  • raw bytes with Content-Type: application/octet-stream (index and detect only)

Limit 30 MB. JPEG, PNG, WebP, HEIC, TIFF, GIF and BMP are accepted. Compare and batch take URLs only.

The five calls

bash
B="https://api.sightradar.com"; AUTH="Authorization: Bearer $SIGHTRADAR_API_KEY"; J="Content-Type: application/json"

# 1. Index: store the faces of a photo in a collection (93). The collection is created on first use.
curl -s -X POST "$B/v1/collections/event-2026/index" -H "$AUTH" -F "file=@./photos/001.jpg" -F "photoId=001"

# 2. Search: which indexed photos contain the person in this selfie? (93)
curl -s -X POST "$B/v1/collections/event-2026/search" -H "$AUTH" -F "file=@./selfie.jpg" -F "limit=50"
# {"matches":[{"photo_id":"001","score":0.91}],"photo_ids":["001"]}

# 3. Compare: same person in two images? (186)
curl -s -X POST "$B/v1/compare" -H "$AUTH" -H "$J" \
  -d '{"sourceUrl":"https://example.com/a.jpg","targetUrl":"https://example.com/b.jpg"}'
# {"face_found":true,"similarity":0.83,"match":true,"threshold":...}

# 4. Detect: faces, boxes and quality, nothing stored (93)
curl -s -X POST "$B/v1/detect" -H "$AUTH" -F "file=@./photo.jpg"

# 5. Balance and usage (free)
curl -s "$B/v1/wallet" -H "$AUTH"
curl -s "$B/v1/usage?days=30" -H "$AUTH"

Thresholds

Scores are cosine similarity from 0 to 1. No single cut-off is right for every use, so do not invent one:

  • Calibrate on the user's own photos: score a few hundred same-person pairs and different-person pairs, and put the cut-off where the two groups separate.
  • Use two bands. Above the high one accept automatically, between the two ask the user ("Is this you?") or send to review, below the low one reject.
  • Photo discovery in galleries can be looser. Identity checks should be strict.
  • threshold and limit only cap what the API returns. Keep the accept, review and reject logic in the user's code.

Guide: https://sightradar.com/docs/guides/thresholds

Errors

The body is {"error": "...", "error_code": "...", "error_detail": {"code","message","docs_url"}}. Branch on error_code when it is present.

HTTP Meaning Next step
400 Bad body, or the image cannot be fetched or decoded Fix the request. Not charged.
401 Key missing, invalid or revoked Check $SIGHTRADAR_API_KEY
402 Out of credits Top up at https://sightradar.com/dashboard/billing. Free calls still work.
403 Account is read-only, or the key lacks the scope Use a key that owns the resource
404 Collection, batch or photo not found Check the id with GET /v1/collections
409 Idempotency-Key already used, or the collection is being deleted The first call already ran. Do not retry with a new key.
413 Image over 30 MB Downscale to about 4000 px on the long side
429 Rate or concurrency limit Back off with jitter, retry. Use batch for bulk work.
502, 503 Temporary engine or service error (any charge is refunded) Retry with the same Idempotency-Key

A search that finds nothing returns 200 with empty matches and a reason: no_face (no face in the query image), low_quality_selfie (the face failed the quality gate) or point_not_found. These searches are charged.

Examples

Prompt

I want to find all photos of my friend in my collection using a selfie I took.

Output

First, index your friend's selfie into a named collection with the index call, providing the photo image and a unique photoId. Then use the face-search call with the selfie image to find matching faces in that collection. This will return photoIds of all photos containing your friend. Each indexing and search call costs 93 credits, so ensure your balance covers these calls before proceeding.

Prompt

Can you check if these two photos are of the same person?

Output

Use the face-compare call by providing URLs of the two photos you want to compare. The API will return a similarity score indicating the likelihood the faces match. This call costs 186 credits (93 per image). Make sure your API key is set and you have enough credits. The response includes a resemblance score, but remember this is not a definitive identity check.

Explore more skills

Browse all
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Frequently asked questions about face-recognition

What does the face-recognition skill do?

Face recognition with the SightRadar API. Use when the user wants to recognise, match, search, compare, verify or detect faces in photos, build a "find my photos from a selfie" feature, tag people across a photo library, add face search to an app, or pick the right face recognition call and estimate what it costs. Covers setup, API key, pricing, image input, thresholds and errors, and points to the task skills (face-search, face-compare, face-detect, face-batch-indexing, face-data-deletion, rekognition-migration). It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the face-recognition skill?

Run `npx @skills-hub-ai/cli install face-recognition` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/face-recognition/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does face-recognition work with?

face-recognition runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the face-recognition skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use face-recognition after installing it?

In Claude Code, type `/face-recognition` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the face-recognition skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.

Badge for your README

Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.

Install on Skills Hub badge preview
Markdown
[![Install on Skills Hub](https://skills-hub.ai/api/badges/skill/face-recognition)](https://skills-hub.ai/skills/face-recognition)
HTML
<a href="https://skills-hub.ai/skills/face-recognition"><img src="https://skills-hub.ai/api/badges/skill/face-recognition" alt="Install on Skills Hub"></a>

More options in the badge docs.