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.
- Python 3.8+
- Single dependency:
requests - Full API reference: https://docs.finevoice.ai
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(or3).failedor a numeric status of4or higher raisesFineVoiceError. - Any other status keeps polling. Transient gateway errors (5xx on proxy paths) are retried.
- Raises
FineVoiceErroriftimeoutseconds 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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| finevoice-0.1.2.tar.gz | 4.5 kB | Without provenance | Details for finevoice-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| finevoice-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for finevoice-0.1.2-py3-none-any.whl |
Total release size: 9.6 kB
Release files / finevoice-0.1.2.tar.gz
| Download URL | finevoice-0.1.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d2671b0098dc4f16ebfe86eab99eafe4997436ba5d3c0b9ec55a8d2e05cf1b6
|
|
BLAKE2b-256 checksum How to use checksums |
4a0b928947182f5feb1fda70340ef49b7d7e2bceedd255b89530cc9e34842921
|
| 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.2-py3-none-any.whl
| Download URL | finevoice-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8789c4a60e69aa100f7df96275ec099299891a930aa97c550da888159e3735d2
|
|
BLAKE2b-256 checksum How to use checksums |
24e13ba62da58b150658f04170a6c28652ece63d4fba942c1c48df15740b42f5
|
| 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.2
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.