Python SDK quickstart
Install, authenticate, and call every Latentface endpoint from Python — sync and async clients, typed responses, and automatic retries.
By Latentface TeamUpdated
Requirements
- →Python 3.9+
- →pip or poetry
Steps
Install
`pip install latentface` or `poetry add latentface`. The package ships wheels for CPython 3.9 through 3.13.
Synchronous client
`from latentface import Client; client = Client()` picks up `LATENTFACE_API_KEY`. All calls return typed dataclasses.
Async client
`from latentface import AsyncClient; async with AsyncClient() as client: await client.embed(...)` — built on httpx with automatic retries.
Typed responses
Every response is a dataclass (`SwapResult`, `EmbedResult`, etc.) with full IDE autocompletion. No untyped dicts.
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.