Skip to main content

FineVoice Python SDK

Official Python client for the FineVoice API: text to speech, voice conversion, speech to text, sound effects, music generation, voice design/training, and audio enhancement.

Installation

pip install finevoice

Authentication

Create an API key in the FineVoice dashboard and pass it to the client. Keep it out of source control, for example by reading it from an environment variable.

import os
from finevoice import FineVoice

client = FineVoice(os.environ["FINEVOICE_API_KEY"])

Optional constructor arguments:

Argument Default Description
base_url https://apis.finevoice.ai Override the API host.
timeout 120 Per-request timeout in seconds.

Quick start

Most generation endpoints are asynchronous: the call returns a taskId, and you poll until the task finishes. wait_for_task does this for you.

task = client.speech_synthesis({
    "voice": "james",
    "text": "[happy] Hello from FineVoice!",
})

result = client.wait_for_task(task)   # polls GET /v1/task/{taskId}
print(result["url"])

Browse voices

page = client.page_voices(language="en-US", page=0, limit=20)
voice = client.get_voice("james")

Music generation

Music tasks take roughly 50 to 60 seconds. Use the default polling, which allows up to 10 minutes.

task = client.music_gen_by_prompt({"prompt": "calm lo-fi beat with soft piano"})
result = client.wait_for_task(task)
print(result["urls"])        # list of audio URLs

Audio enhancement

The enhancer endpoints respond directly with a download link, so no polling is needed.

out = client.speech_enhancement({"url": "https://example.com/noisy.mp3"})
print(out["download_url"], out["filename"])

Async tasks and polling

client.wait_for_task(task_or_id, interval=5.0, timeout=600.0)
  • Accepts either the submit response (dict) or a task id string.
  • A task is finished when its status is success (or 3). failed or a numeric status of 4 or higher raises FineVoiceError.
  • Any other status keeps polling. Transient gateway errors (5xx on proxy paths) are retried.
  • Raises FineVoiceError if timeout seconds pass without completion.
  • Use client.get_task(task_id) for a single status check.

Available methods

Request bodies use the API field names exactly as in the API reference.

Area Methods
Audio speech_synthesis, voice_conversion, speech_to_text, sfx_generation, audio_separation, enhance_audio, reader_gen, podcast_gen, dubbing_gen
Voices train_voice, design_voice, get_voice, page_voices
Music music_gen_by_prompt, music_gen
Enhancer speech_enhancement, remove_mouth_sounds, remove_long_silences, filler_words_remove, stuttering_remove, audio_normalization, process_pipeline
Tasks get_task, wait_for_task
Low level request(method, path, json=None, params=None) for any endpoint not yet wrapped

Error handling

All failures raise FineVoiceError with:

  • .status: HTTP status code, if any
  • .body: parsed response body
from finevoice import FineVoice, FineVoiceError

try:
    client.speech_synthesis({"voice": "james", "text": "Hi"})
except FineVoiceError as e:
    print(e.status, e.body)

Note that some validation errors are returned by the API as HTTP 200 with an error object (code, message). Submit calls return that body as-is, so check result.get("error"); wait_for_task raises on them.

License

MIT

Metadata

Release files for finevoice 0.1.3

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

Source distribution (sdist)

Source distribution for finevoice 0.1.3
File Size Uploaded Provenance Actions
finevoice-0.1.3.tar.gz 4.6 kB Without provenance Details for finevoice-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for finevoice 0.1.3
File Interpreter ABI Platform Actions
finevoice-0.1.3-py3-none-any.whl Python 3 none any Details for finevoice-0.1.3-py3-none-any.whl

Total release size: 9.6 kB

Release files / finevoice-0.1.3.tar.gz

Download URL finevoice-0.1.3.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
818f529f438cdd7ecacfbf22a41f48a5371c267e1c8f670b72d9afc414a04bf1
BLAKE2b-256 checksum
How to use checksums
96e23e372f6ac5f3e2bf5594f0f0280954387a2954e99e58e0af4fd11e3a3aa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.9

Release files / finevoice-0.1.3-py3-none-any.whl

Download URL finevoice-0.1.3-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56cca421daaf3e8e5a76c134c16e98e00a3ce88e217253f454a4f700109347cd
BLAKE2b-256 checksum
How to use checksums
4757b8d454219f42a50e05e89425f4de6751c8ad541704767fe371c129cf71ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.9

Security for finevoice 0.1.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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