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

# Quickstart

> Endpoints, authentication and your first detect and compare requests.

Send requests to `https://api.huemn.com` with an API key from the [dashboard](https://platform.huemn.com/). Compare and search use the `default` operating point.

For accounts, organizations and keys, see [organizations and accounts](https://docs.huemn.com/account-guide.md). 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](https://docs.huemn.com/integration-guide.md).

## Endpoints

| What | Where |
| - | - |
| API base | `https://api.huemn.com` (developer API under `/v1`) |
| Dashboard | [https://platform.huemn.com/](https://platform.huemn.com/) |
| Docs | [https://docs.huemn.com](https://docs.huemn.com/index.md) |
| Pricing | `GET https://api.huemn.com/v1/pricing`, no key needed; [pricing page](https://www.huemn.com/pricing/) |
| Status | [https://www.huemn.com/status/](https://www.huemn.com/status/) |
| Auth header | `Authorization: Bearer <your API key>` |

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.

```bash theme={null}
curl https://api.huemn.com/v1/pricing
curl https://api.huemn.com/health
```

## Detect

`POST /v1/faces/detect` accepts one JSON image:

```json theme={null}
{"image":{"base64":"<JPEG or PNG bytes encoded as standard base64>"}}
```

From a terminal, with your key in `HUEMN_API_KEY` and an authorized photo in `face.jpg`:

```bash theme={null}
printf '{"image":{"base64":"%s"}}' "$(base64 < face.jpg | tr -d '\n')" > detect.json
curl https://api.huemn.com/v1/faces/detect \
  -H "Authorization: Bearer $HUEMN_API_KEY" \
  -H "Content-Type: application/json" \
  --data @detect.json
```

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](https://docs.huemn.com/face-lifecycle.md). 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](https://docs.huemn.com/account-guide.md). 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.

```typescript theme={null}
const client = new HuemnClient({ apiKey });
const detection = await client.detect(
  { base64: imageBase64 }, undefined, { idempotencyKey: requestIdentity },
);
const comparison = await client.compare(
  { base64: sourceBase64 },
  { base64: targetBase64 },
  operatingPoint,
);
```

```python theme={null}
client = HuemnClient(api_key)
detection = await client.detect(image_base64)
comparison = await client.compare(source_base64, target_base64, operating_point)
```

For browser evaluation, use **Playground** in the [dashboard](https://platform.huemn.com/) 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](https://docs.huemn.com/account-guide.md) 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](https://docs.huemn.com/collections.md) and [face enrollment, search and consent](https://docs.huemn.com/face-lifecycle.md) 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](https://www.huemn.com/pricing/) for request tiers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.