Guides/Python SDK
🐍SDK

Python SDK

Install, authenticate, and call every Latentface endpoint from Python. Async support included.

Requirements

  • Python 3.9+
  • pip or poetry
1

Install

`pip install latentface` or `poetry add latentface`. The package ships wheels for CPython 3.9 through 3.13.

2

Synchronous client

`from latentface import Client; client = Client()` picks up `LATENTFACE_API_KEY`. All calls return typed dataclasses.

3

Async client

`from latentface import AsyncClient; async with AsyncClient() as client: await client.embed(...)` — built on httpx with automatic retries.

4

Typed responses

Every response is a dataclass (`SwapResult`, `EmbedResult`, etc.) with full IDE autocompletion. No untyped dicts.

Tip: Enable strict mypy — the type stubs are exhaustive.
5

Retry policy

Default: 3 retries with exponential backoff on 5xx and rate-limit responses. Override with `Client(max_retries=0)` for explicit control.

Ready to go live?

Start your first Latentface session for free — no credit card required.