Skip to main content

FlowSpeech Python SDK

Python 3.12+ client for the FlowSpeech public API. An active paid Basic, Pro or Scale subscription and a developer API key are required. Trial access does not include API generation. Generation consumes account credits.

pip install flowspeech-sdk==0.2.0
export FLOWSPEECH_API_KEY='YOUR_FLOWSPEECH_API_KEY'
from pathlib import Path
from uuid import uuid4
from flowspeech_sdk import FlowSpeechClient, FlowSpeechError

request_id = str(uuid4())  # Persist this before submission; reuse it for the same input.
print("Recovery request ID:", request_id)
with FlowSpeechClient(timeout=300) as client:
    print(client.get_account())  # Read-only quota, subscription and limits.
    try:
        result = client.synthesize("Hello from FlowSpeech", voice="Kore", request_id=request_id)
        with Path("speech.wav").open("xb") as output:
            output.write(result.audio)
    except FlowSpeechError as error:
        print(error.code, error.request_id, error.job_id)
        raise

Calls are blocking. Async applications should schedule them in a worker thread. Never place the API key in browser code or publish it in logs or source files.

Recovery and Multi-Speaker Audio

Use find_job(request_id) after a lost response, get_job(job_id) to check status, and download(job_id) to retrieve an existing successful recording. A download retry does not create another recording. cancel_job(job_id) explicitly requests cancellation; a local timeout does not automatically cancel remote work.

segments = [
    {"speaker": "Alice", "text": "Welcome.", "voiceName": "Kore"},
    {"speaker": "Bob", "text": "Thank you.", "voiceName": "Puck"},
]
with FlowSpeechClient() as client:
    result = client.synthesize_multi(segments, request_id=str(uuid4()))

Supply a caller-persisted UUID for robust recovery even if the process is stopped. Retries preserve the same UUID and serialized input. Polling waits at least five seconds and honors longer server cooldowns. The configurable total deadline includes HTTP requests, polling and audio download; it defaults to 120 seconds.

Migration from 0.1.0

  • API keys are required, either explicitly or through FLOWSPEECH_API_KEY.
  • synthesize(text, voice=...) and the SynthesisResult.audio bytes remain.
  • Calls use /api/v1/tts/jobs with submit, poll and separate download operations.
  • get_quota() keeps its quota-only mapping; get_account() includes subscription and limits.
  • Output is validated PCM WAV, 24 kHz, mono, 16-bit. MP3, model and speed options are unsupported.
  • quota on a synthesis result remains None; billing is available as usage.
  • This release adds an httpx dependency. Custom API URLs must use HTTPS and the v1 paths.
  • Error types retain request/job IDs and structured codes for recovery.

API redirects are rejected. Audio downloads use a separate credential-free request, validate HTTPS redirects, enforce a 64 MiB bound and validate the WAV container. A deleted result is reported explicitly. No API credentials or cookies are sent to audio storage.

Development

pip install -e '.[test]'
pytest -q
python -m build

Tests use synthetic audio and mock HTTP transports. They do not generate paid audio.

Metadata

Release files for flowspeech-sdk 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flowspeech-sdk 0.2.0
File Size Uploaded Provenance
flowspeech_sdk-0.2.0.tar.gz 18.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for flowspeech-sdk 0.2.0
File Interpreter ABI Platform
flowspeech_sdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / flowspeech_sdk-0.2.0.tar.gz

Download URL flowspeech_sdk-0.2.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ed38412e71577bdf42bbfb04765387d5d07d020048f6fe045a407d04fc3bcfaa
BLAKE2b-256 checksum
How to use checksums
e1224828df9c0e5dba7ae6a3269357b1fac29e1cf91837f2a819c4bea06bc1ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Release files / flowspeech_sdk-0.2.0-py3-none-any.whl

Download URL flowspeech_sdk-0.2.0-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8156c4b02d24a4e71481d97a0d683fba18bc13593521c580e377ba07ed9a92b2
BLAKE2b-256 checksum
How to use checksums
3223e3b3fd1d3d109d1beef619fe4a6d98f0ac2413d61e41ec6dd67e78190cfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

Security for flowspeech-sdk 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flowspeech_sdk-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page