Prim Voices API Python Client
A Python client for interacting with the Prim Voices API.
Installation
pip install primvoices
Usage
from primvoices import Client
from primvoices.models import ClientConfig
# Initialize the client
client = Client(ClientConfig(
api_key='your-api-key',
# Optional: override the base URL
# base_url='https://custom-api-url.com'
))
# Using context manager (recommended)
with Client(ClientConfig(api_key='your-api-key')) as primvoices:
# Your code here
pass
# Working with Voices
async def voice_examples():
# List all voices
voices = client.voices.list()
print('Your voices:', voices.data)
# List public voices
public_voices = client.voices.list_public()
print('Public voices:', public_voices.data)
# Create a new voice
new_voice = client.voices.create({
'name': 'My Custom Voice',
'sample_url': 'https://example.com/sample.wav',
'verified': True # Required: User must explicitly verify they have permission to use this voice
})
print('Created voice:', new_voice.data)
# Get a specific voice
voice = client.voices.retrieve('voice_id')
print('Voice details:', voice.data)
# Get a public voice
public_voice = client.voices.retrieve_public('public_voice_id')
print('Public voice details:', public_voice.data)
# Working with Generations
async def generation_examples():
# List all generations
generations = client.generations.list()
print('All generations:', generations.data)
# Create a new text-to-speech generation
new_generation = client.generations.create({
'voice_id': 'voice_id',
'text': 'Hello, this is a test generation.',
'quality': 'high',
'notes': 'Read in a friendly tone'
})
print('Created generation:', new_generation.data)
# Create a voice cloning generation
voice_clone = client.generations.create({
'voice_id': 'voice_id',
'source_url': 'https://example.com/source-audio.wav',
'quality': 'voice'
})
print('Created voice clone:', voice_clone.data)
# Get a specific generation
generation = client.generations.retrieve('generation_id')
print('Generation details:', generation.data)
API Resources
Voices
client.voices.list()- List all voices for the authenticated userclient.voices.list_public()- List all public voicesclient.voices.create(params)- Create a new voiceclient.voices.retrieve(voice_id)- Get a specific voiceclient.voices.retrieve_public(voice_id)- Get a specific public voiceclient.voices.delete(voice_id)- Delete a voice
Generations
client.generations.list()- List all generationsclient.generations.create(params)- Create a new generationclient.generations.retrieve(generation_id)- Get a specific generationclient.generations.delete(generation_id)- Delete a generation
Development
- Clone the repository
- Install dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
License
MIT
Metadata
Release files for primvoices 0.1.0
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 |
|---|---|---|---|---|
| primvoices-0.1.0.tar.gz | 5.7 kB | Without provenance | Details for primvoices-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| primvoices-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for primvoices-0.1.0-py3-none-any.whl |
Total release size: 12.5 kB
Release files / primvoices-0.1.0.tar.gz
| Download URL | primvoices-0.1.0.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1822c58437f2f89b1782bd23ae965e67d81e74552fc552ea71660d4bca366ff2
|
|
BLAKE2b-256 checksum How to use checksums |
c330ee5cc6fa1883851e578b5b52627875dff27d9eab336de65c86bbc6f572d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.2
|
Release files / primvoices-0.1.0-py3-none-any.whl
| Download URL | primvoices-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
78b821d7d3c5232b600e1a0f60ebc4bfb1ef6d8208e71befaa1bbecaace72315
|
|
BLAKE2b-256 checksum How to use checksums |
066aa19c24aaaa1d79904f4445ba75738a27cf4c83b6e8f89045b87941a78228
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.2
|
Security for primvoices 0.1.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.
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.