Embeddings API · v1 beta

Image and text embeddings for semantic search.

Start with CLIP 2: encode a photo, a description, or both into one shared vector space, then retrieve the closest saved embeddings by ID.

Successful requests only

$0.000042CLIP 2 / request
$0.0025Person ReID / image
  • Image + text in one 768-D space
  • Encrypted 30-day vector retention
  • Warm target under 3 seconds

Quickstart

Your first embedding in one request.

Create a named key below. Send exactly one crop containing one person. Detection, tracking and multi-person splitting are intentionally outside v1.

Need competition uploads, human review, galleries and a storefront instead of an embedding endpoint? Explore the Person ReID app for event photo workflows.

  1. 1 Create an account and accept the API Terms in the Generate modal.
  2. 2 Generate a named key with $10 of evaluation credit included.
  3. 3 Upload a static JPEG, PNG or WebP crop.
terminal
curl https://polyreid.com/api/v1/embeddings \
  -H "Authorization: Bearer $POLYREID_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "[email protected]" \
  -F "retention=none" \
  -F "model=polyreid-person-reid-v1"

CLIP 2 · SigLIP2

One space for photos and prompts.

Use the same model for an image such as a car and text queries such as “front view” or “back view”. Set retention=30d to receive a durable ID that can be searched later.

01Encode an image

Send one image and get its normalized vector plus a searchable ID.

curl · image
curl https://polyreid.com/api/v1/embeddings/clip2 \
  -H "Authorization: Bearer $POLYREID_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "[email protected]" \
  -F "model=polyreid-clip2" \
  -F "retention=30d"
02Encode a prompt

Text and images are comparable because they use the same CLIP 2 space.

curl · text
curl https://polyreid.com/api/v1/embeddings/text \
  -H "Authorization: Bearer $POLYREID_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"model":"polyreid-clip2","text":"front view of a red sports car","retention":"30d"}'

Agent skill

Give the complete workflow to your LLM agent.

It includes authentication, image and text encoding, ID-based search, the five-view vehicle workflow, and safe score handling.

---
name: polyreid-embeddings
description: Use PolyReID CLIP 2 (SigLIP2) to create image and text embeddings, compare images with prompts, and run semantic nearest-neighbour search.
---

# PolyReID Embeddings API

Use this skill when a task requires semantic image search, image–text matching, vehicle-view analysis, automatic labelling, or a first-pass anomaly review.

The service exposes CLIP 2 through a commercial API backed by SigLIP2. Images and text are mapped into the same normalized 768-dimensional embedding space. The API returns the vector, the model revision, the preprocessing version, and an ID. Use the ID for later searches when the embedding was created with `retention=30d`.

## Authentication and setup

1. Sign in at `https://polyreid.com/api`.
2. In the Developer Console, click **Generate**.
3. Review and accept the current developer terms in the confirmation modal.
4. Copy the returned secret immediately. It is shown only once.
5. Store it in a server-side environment variable such as `POLYREID_API_KEY`.

The account starts with a $10 evaluation balance. Never expose the Bearer key in browser code, client-side logs, prompts sent to third parties, or a source repository.

```bash
export POLYREID_API_KEY="preid_live_..."
export POLYREID_BASE_URL="https://polyreid.com"
```

## Non-negotiable request rules

- Send `Authorization: Bearer $POLYREID_API_KEY` on every API request.
- Generate a fresh `Idempotency-Key` for every new embedding request.
- Use `retention=30d` when the result must be searched later by ID. Use `retention=none` when no retained search is needed.
- Keep `model_revision` and `preprocess_version` next to every stored ID or vector.
- Compare vectors only when model, revision, and preprocessing version match.
- Treat similarity as ranking evidence, not as a calibrated probability, identity proof, or legal decision.
- Preserve a human review path for ambiguous, low-quality, or consequential cases.

## Core endpoints

### 1. Encode an image

The image endpoint accepts one JPEG, PNG, or WebP file in the multipart field `image`.

```bash
curl "$POLYREID_BASE_URL/api/v1/embeddings/clip2" \
  -H "Authorization: Bearer $POLYREID_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "[email protected]" \
  -F "model=polyreid-clip2" \
  -F "retention=30d"
```

The response contains an `id`, `embedding`, `dimensions: 768`, `normalized: true`, `model_revision`, `preprocess_version`, `expires_at`, and `charged_usd`.

### 2. Encode text

Use natural-language descriptions, view labels, or search prompts. The text embedding is comparable with image embeddings.

```bash
curl "$POLYREID_BASE_URL/api/v1/embeddings/text" \
  -H "Authorization: Bearer $POLYREID_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "polyreid-clip2",
    "text": "front view of a dark red sports car",
    "retention": "30d"
  }'
```

### 3. Search by embedding ID

After an image or text embedding has been retained, send only its ID to search the account’s retained vectors.

```bash
curl "$POLYREID_BASE_URL/api/v1/search" \
  -H "Authorization: Bearer $POLYREID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "embedding_id": "cm_embedding_id",
    "top_k": 10
  }'
```

The response contains ranked neighbors and a proximity score. The search is account-scoped and excludes the query vector itself.

## Main workflow: five-view vehicle dossier

When checking whether a client dossier contains consistent views of one vehicle:

1. Encode the five supplied images with `retention=30d`.
2. Store each returned ID with the dossier ID, expected view label, model revision, preprocessing version, source URI, and expiry.
3. Encode prompts such as `front view`, `back view`, `left side`, `right side`, or `interior view` when automatic view labelling is useful.
4. Search an incoming image ID against the retained dossier embeddings.
5. Compare the best score, the margin to the second candidate, view completeness, image quality, and consistency across all views.
6. Route the dossier to one of three review states:
   - **solid**: multiple views agree and the margin is strong;
   - **review**: the candidate is plausible but the margin is weak, a view is missing, or quality is poor;
   - **rework**: the image is invalid, too ambiguous, or inconsistent with the dossier.

Do not call the score a probability unless the application has calibrated it on a representative validation set. A nearest neighbor is simply the closest available candidate; it can still be wrong when the correct vehicle is absent.

## Automatic labelling and anomaly review

Use CLIP 2 for a flexible first pass:

- suggest front/back/side/interior labels;
- find images matching a text description;
- group visually and semantically related images;
- flag images that are far from the rest of a dossier;
- select candidates for human review.

After that pass, add specialist models where needed: vehicle detector, OCR, damage classifier, image-quality model, fine-grained make/model classifier, or metadata consistency rules. Let each model answer a narrow question. Combine their evidence instead of turning one embedding score into an automatic identity decision.

## Failure handling

- `401`: check the Bearer key and never retry with a key embedded in client code.
- `402`: the available balance is insufficient; failed requests are not charged.
- `413` or `415`: validate file size, pixels, and JPEG/PNG/WebP format before retrying.
- `409`: reuse the original response only when the same idempotency key and payload are intended; otherwise generate a new key.
- `429`: back off using response rate-limit headers.
- `503` or `504`: retry safely with the same idempotency key when the request may have reached inference.

For the complete contract, current limits, retention policy, and pricing, use `https://polyreid.com/api` and `https://polyreid.com/api/v1/openapi.json` as the source of truth.
Download SKILL.mdServe it directly to an agent from /skills/polyreid-embeddings/SKILL.md.

Lire le guide : rechercher des images avec des mots grâce à CLIP →

Immutable model contract

Portable vectors, explicit compatibility.

Store the model revision and preprocessing version beside every vector. Compare embeddings only when both values match.

Model
polyreid-person-reid-v1
Output
768 × float32
Normalization
L2 unit norm
Preprocess
person-crop-256x128-v1
Formats
JPEG · PNG · WebP
Limits
10 MB · 25 MP · static
200 application/json
{
  "id": "cm...",
  "request_id": "req_...",
  "model": "polyreid-person-reid-v1",
  "model_revision": "<sha256>",
  "preprocess_version": "person-crop-256x128-v1",
  "embedding": [0.018, -0.044, 0.091, "... 768 values"],
  "dimensions": 768,
  "dtype": "float32",
  "normalized": true,
  "retention": "none",
  "expires_at": null,
  "charged_usd": "0.002500",
  "balance_usd": "9.997500"
}

Volume calculator

Know the bill before you integrate.

Price is captured only after a valid vector is produced and, for 30-day mode, encrypted storage succeeds.

Vector retention
Estimated API spend$25.00Taxes, when applicable, are added to credit deposits.

Stable failures

Every error includes a request_id.

401API_KEY_REQUIRED / INVALID_API_KEY

Create, rotate or replace the Bearer key.

402INSUFFICIENT_CREDITS

Add prepaid credit; failed requests are not charged.

409IDEMPOTENCY_KEY_REUSED

Use a new key when the payload or options change.

413IMAGE_TOO_LARGE

Stay below 10 MB and 25 megapixels.

415UNSUPPORTED_IMAGE_TYPE

Send an actual JPEG, PNG or WebP file.

422INVALID_IMAGE

Send one valid, static person crop.

429RATE_LIMIT_EXCEEDED

Back off using the response rate-limit headers.

503INFERENCE_UNAVAILABLE

Retry safely with the same Idempotency-Key.

504INFERENCE_TIMEOUT

Retry safely; the timed-out attempt is not charged.

Privacy, versioning and use

A production boundary you can explain.

No source-image persistence

Image bytes exist only in request memory and a bounded in-memory GPU micro-batch. They are not written to PostgreSQL, Redis, B2, logs or Sentry.

Idempotence without double spend

An encrypted response cache lives for 24 hours. Retrying the same payload with the same key returns the original response and charge.

Optional 30-day vector storage

Only the encrypted embedding and technical model metadata are retained. Delete it early at any time; expiration blocks access immediately.

Lawful commercial use

You must have rights, notices and a lawful basis for the images. Outputs are probabilistic review candidates, never proof of identity.

Version stability

V1 is never silently retargeted. An incompatible model becomes v2; announced deprecated versions remain available for at least 12 months.

Beta operating target

No contractual SLA during beta. The internal target is 99.5% availability, warm P95 ≤ 3 seconds and cold P95 ≤ 60 seconds.

Responsible use, biometrics and EU AI Act

Define the deployment before relying on the output.

Assessment statusEU AI Act classification under legal assessmentLast reviewed 2026-07-24
01

Intended purpose

Match individual person crops inside offline photo workflows for similarity retrieval and trained human review.

02

Not an identity decision

V1 does not detect people, recognise faces, assign names, track people live or make automated decisions.

03

Human oversight

Validate thresholds and error rates on your own domain. Give a trained reviewer enough context to reject or correct a match.

04

Prohibited boundaries

No unlawful biometric use, sensitive-attribute categorisation, prohibited emotion recognition, social scoring or prohibited law-enforcement use.

No conformity claim

Classification depends on the intended purpose, integration and actual use. This public information does not replace risk management, technical documentation, post-market monitoring or a required conformity assessment.

Developer console

Keys, balance and evidence in one place.

Private account data below is never rendered into the public SEO document.

Checking your developer account…