Skip to main content
FaceSign uses API keys to authenticate all requests. Every request — sandbox or production — goes to the same base URL:
What distinguishes sandbox from production is the key prefix and the quotas attached to it: If you don’t have a key yet, see the Build with AI quickstart.

Using API keys

Pass the key as a Bearer token in the Authorization header:
The key prefix is the only thing that changes between environments — swap sk_test_... for sk_live_... and the same code hits production.

Client secrets

Each session generates a single-use client secret (prefixed cs...) containing an embedded URL, expiration timestamp, and authentication credentials for that specific session. Client secrets are safe to expose to the frontend. API keys must never leave the server.
Create session on backend, pass secret to frontend

Security rules

API Key SecurityYour API keys grant access to sensitive data and actions. Handle them carefully.
  • API keys: server-side only. Never embed in client code, public repos, or browser environments.
  • Client secrets: safe for the frontend, but single-use and short-lived.
  • For frontend integration, create sessions on your backend and pass only the client secret URL to the user.

Environments

Both environments share the same base URL (https://api.facesign.ai). The key prefix is what routes your request into the right environment.

Rate limits

When rate limited, the API returns 429 with a rate_limit_exceeded code. Implement exponential backoff with jitter: 1s, 2s, 4s, and so on.

Retry guidance

  • Network errors and 5xx responses: retry with exponential backoff (up to 3 attempts).
  • 429 responses: respect the rate limit window, then retry.
  • 4xx responses (except 429): do not retry. Fix the request.
  • Media download failures: re-fetch the session to get a fresh URL (they expire after 15 minutes).