Skip to main content

Installation

You can interact with the TTSLab API through HTTP requests from any language. For Python, we recommend using the requests library with a virtual environment.

Python Setup

Create a virtual environment and install requests:

Node.js Setup

For Node.js projects, install the required packages:

API Base URL

All API requests should be made to:

Authentication

All API requests require authentication using the X-API-KEY header:

Available Endpoints

Endpoints

  • Text-to-Speech: POST /v1/text-to-speech - Convert text to speech
  • Models: GET /api/tts/models/ - List available models
  • Voices: GET /api/tts/voices/ - List available voices
  • History: GET /api/tts/elevenlabs-histories/ - Get generation history

Voice Management

  • Create Voice: POST /api/tts/voices/ - Create a new voice
  • Get Voice: GET /api/tts/voices/{voice_id} - Get voice details

User Management

  • User Profile: GET /api/users/me/ - Get user profile

Response Format

All API responses are returned in JSON format with the following structure:

Error Handling

Errors are returned with appropriate HTTP status codes and error messages: