--- title: "Voice Profiles API" description: "Manage voice profiles programmatically" --- ## Endpoints ### List Profiles ```http GET /profiles ``` **Response:** ```json { "profiles": [ { "id": "abc123", "name": "John Smith", "language": "en", "description": "Professional narrator", "created_at": "2024-01-29T12:00:00Z", "sample_count": 2 } ] } ``` ### Get Profile ```http GET /profiles/{id} ``` **Response:** ```json { "id": "abc123", "name": "John Smith", "language": "en", "description": "Professional narrator", "created_at": "2024-01-29T12:00:00Z", "samples": [ { "id": "sample123", "duration": 15.5, "created_at": "2024-01-29T12:00:00Z" } ] } ``` ### Create Profile ```http POST /profiles ``` **Request:** ```json { "name": "John Smith", "language": "en", "description": "Professional narrator" } ``` **Response:** ```json { "id": "abc123", "name": "John Smith", "language": "en", "description": "Professional narrator", "created_at": "2024-01-29T12:00:00Z" } ``` ### Update Profile ```http PUT /profiles/{id} ``` **Request:** ```json { "name": "Updated Name", "description": "Updated description" } ``` ### Delete Profile ```http DELETE /profiles/{id} ``` **Response:** ```json { "success": true } ``` ### Add Voice Sample ```http POST /profiles/{id}/samples ``` **Request:** (multipart/form-data) ``` audio: ``` **Response:** ```json { "sample_id": "sample123", "duration": 15.5 } ``` ## TypeScript Example ```typescript import { VoiceboxClient } from '@/lib/api' const client = new VoiceboxClient({ baseUrl: 'http://localhost:17493' }) // Create profile const profile = await client.createProfile({ name: 'John Smith', language: 'en', description: 'Professional narrator' }) // Add sample await client.addSample(profile.id, audioFile) // List all profiles const profiles = await client.listProfiles() ``` For full API documentation, visit `http://localhost:17493/docs` when the server is running.