PyPI
flam-finesse, for Python 3.10+. Built on httpx, Pydantic and websockets.Source on GitHub
homingos/finesse-python, Apache-2.0. The full README and every option live there.Install
flam-finesse; you import it as flam_finesse.
Create an API key in the dashboard
under Developers → API Keys, and put it in your environment, where the client reads it:
Hello, Finesse
hello.py
hello.wav is a 24 kHz WAV file.
Text to speech
speech.create returns the whole clip in one response. speech.stream sends audio as it is
generated, so playback can start before the clip is finished:
output_format ("wav", raw PCM formats, or "mulaw" for phone calls) and
sample_rate. See Synthesize speech for every parameter.
Async
AsyncFinesse has the same methods as Finesse, with await:
Realtime
Realtime is for voice agents: one WebSocket, text in as your LLM writes it, audio back as fast as the engine makes it, and cancel on barge-in. It uses the async client:send text as it arrives and finish() the turn; call
cancel() when the user interrupts. The concepts, events and limits are the same as in the
TypeScript Realtime guide.
Direct sessions
For the lowest latency, a direct session runs the socket straight against the synthesis GPU in your account’s region:connect_direct.
Errors
Every error derives fromflam_finesse.FinesseError. HTTP errors carry status_code, a
machine-readable code (branch on this, not on the message), retry_after and request_id:
Idempotency-Key, so the client’s automatic retries never bill
twice. See Errors for every code.

