Skip to main content
Send requests to https://api.huemn.com with an API key from the dashboard. Compare and search use the default operating point. For accounts, organizations and keys, see organizations and accounts. Browser sessions and machine API keys have separate purposes. For a step-by-step path from signup through enrollment, search and deletion, use the integration guide.

Endpoints

Create an account and an API key in the dashboard. Keep keys in runtime configuration on your server; never put them in browser code, URLs or source control.

Detect

POST /v1/faces/detect accepts one JSON image:
From a terminal, with your key in HUEMN_API_KEY and an authorized photo in face.jpg:
Supply Authorization: Bearer <runtime key>. The response contains requestId, modelVersion and faces. Each face contains boundingBox (normalized left, top, width and height) and confidence. Detection never returns embeddings. Boxes refer to encoded pixel coordinates; the current internal preprocessing ignores EXIF orientation.

Compare

POST /v1/faces/compare accepts sourceImage, targetImage and operatingPoint. Both image objects have the same base64 shape as detection. Each image must contain exactly one face; otherwise the API returns 422. A successful response contains the model and operating-point artifact versions, cosine score, configured threshold and boolean match. A score is not an identity probability. An operating-point name must already exist in the operator configuration and bind the same model. A synthetic development threshold is not evidence of a particular false-match rate. Calibrate on authorized data before using a customer acceptance threshold.

The default operating point

Production configures one operating point, default, with threshold 0.4311 on the cosine score scale (−1 to 1). Compare returns match: true when score >= threshold; search returns only candidates whose score is at least the threshold. Its operatingPointVersion is sha256:c97d2278d971e8b33f10c99e892e466b9196963d3f62a87f7a571c36a8d4f7d1, the SHA-256 of the canonical JSON {"basis":"ve-1.0-gallery-grouping","calibrated":false,"modelVersion":"sha256:06fdfe3ca138f3431f62c718ad88ec17151e3ab107382fc7ad2e88da4541939a","name":"default","scoreScale":"cosine","threshold":0.4311}. The value is inherited, not calibrated. Ve’s production photo-gallery face grouping runs the same embedding model and groups a face with existing faces when its ranking score (tanh((1.224676 − (2 − 2·cosine)) × 6.322647217) + 1) / 2 is at least 0.75, which is cosine 0.4311. Ve computes that cosine on int8-quantized embeddings; Huemn uses the float embeddings, so results near the threshold can differ slightly. No false-match or false-non-match rate has been measured for this threshold, and it is not an accuracy claim. Calibration on authorized customer data comes with the Delhi pilot and will ship as a new operating point with its own version.

Admission identity and credits

For operator-activated credit admission, detect and compare accept an optional single Idempotency-Key header containing 16–128 characters from A–Z, a–z, 0–9, ., _, : and -. Enrollment and search accept the same header; see enrollment retry identity. Persist an opaque request identity in your authorized application before sending. Do not put personal information in the key. Without a key, detect, compare and search are fresh attempts. Except for a committed identical enrollment returning its canonical current face metadata, an identical admitted retry returns HTTP 409 ADMISSION_ALREADY_EXISTS with { error, admission }. The admission contains id, state, units, policyVersion, createdAt and nullable completedAt; states are admitted, unknown, succeeded, failed or released. This is accounting status only: it does not run inference again or return the earlier biometric result, even when state is succeeded. A changed request under the same key returns 409 IDEMPOTENCY_CONFLICT. Current authorization still applies to retries. Account mode determines how credits are represented. Legacy accounts retain integer service units, represented as decimal strings; they are not converted to money. Configured monetary accounts use USD micro-units (one micro-unit is USD 0.000001), also represented as decimal strings, with a versioned price book and separate promotional and paid balances. Where the self-serve campaign is configured, creating an organization can allocate an eligible verified user a single $1 promotional trial; creating more organizations does not grant more trials. The backend reports the actual trial outcome, including already claimed, unverified, exhausted or unavailable. Only an organization owner can initiate a purchase from the configured package catalog. A Stripe return page does not establish settlement. See [account modes, trial status and purchases](/account-guide). Current prices, trial and volume tiers are on the [pricing page](https://www.huemn.com/pricing/) and at `https://api.huemn.com/v1/pricing`. Prepaid credits start at $10. Admission holds credits before execution and releases them if the request fails. You’re charged only for requests that are processed successfully. Failed requests, reads and data deletion are free. Compensating refunds require an operator. Missing policy returns 503 CREDIT_POLICY_UNAVAILABLE, insufficient balance 402 INSUFFICIENT_CREDITS, and invalid admission identity 400 INVALID_IDEMPOTENCY_KEY. None of these source contracts establishes hosted availability.

Private SDK sources

TypeScript source lives in huemn-web/packages/api-client; Python source lives in huemn-backend-services/sdk/python. Both default to https://api.huemn.com, validate response structure and use bounded total deadlines without automatic retries. Applications decide whether to repeat an operation; admission deduplication does not replay inference results.
For browser evaluation, use Playground in the dashboard after selecting your organization, environment and purpose. Detection and comparison use your signed-in session; do not paste a machine API key into the dashboard. Collections contains enrollment and search. See the account guide for access and permissions. For local development only, engineers run npm run dev from huemn-web to open a loopback copy of the dashboard against a separately configured Rust control plane. Cancellation stops the client connection; inference already running may finish to preserve bounded worker capacity.

Faster requests

Reuse one client for all requests. Every new HTTPS connection costs a TCP and TLS handshake, about half a second from India to the API region. Both SDKs keep connections open between calls: the TypeScript client uses the runtime’s fetch, which pools keep-alive connections in Node and browsers, and the Python client keeps one connection pool per HuemnClient (use async with HuemnClient(...) as client, or await client.aclose() when you are done). Resize before you send. The detector analyses every image at 640 x 640, so pixels beyond about 1024 on the long edge only add upload time and server decoding. Scale the long edge to at most 1024 px and re-encode as JPEG at quality about 85. A typical phone photo drops from several hundred kilobytes or more to under 250 KB, which on a slow uplink is most of the request time. Apply this to both images in a comparison and to enrollment and search images. Images larger than 1 MiB must use a private upload reference (prepareImage in TypeScript, prepare_image in Python). The reference path sends raw bytes straight to storage instead of base64, which is a third larger, and keeps the API request small. Resizing first is still the bigger saving.

Limits and failures

JPEG and PNG only, maximum 5 MiB per image (1 MiB inline as base64; larger images use an upload reference), 8192 pixels per side and 20 million pixels. No data-URL prefix. Invalid input returns 400/413, invalid or insufficient credentials 401/403, no/multiple comparison faces 422, rate/capacity limits 429 and dependency failure 503. Retain the safe request ID for support; do not log image bodies, API keys, embeddings or linkable scores. Only process images you are authorized to use. The dashboard acknowledgement is not a substitute for data-subject consent, applicable lawful basis or processing terms. Continue with collections and deletion and face enrollment, search and consent for the implemented lifecycle interfaces. Enrollment persists a face template under the retention policy; it is not transient-only processing.

Face storage pricing

Planned price: $0.01 per 1,000 stored face-months, prorated. Storage billing is not active; no storage credits are deducted yet. Catalog version: 2026-12-02-storage-preview-1. See the pricing page for request tiers.