> ## Documentation Index
> Fetch the complete documentation index at: https://docs.play.ht/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

Welcome to PlayHT

The PlayHT API provides a simple interface to our state-of-the-art AI TTS models. Follow this guide to get started.

## 1. Create authentication credentials

Generate a user ID and API key [in the dashboard](https://play.ht/studio/api-access).

## 2. Install the SDK (optional)

```Text npm
npm install playht
```

```Text pnpm
pnpm install playht
```

```Text yarn
yarn add playht
```

```Text pip
pip install pyht
```

## 3. Make your first request

```javascript Node.js
import * as PlayHT from 'playht';
import fs from 'fs';

// Initialize client
PlayHT.init({
  userId: '<YOUR_USER_ID>',
  apiKey: '<YOUR_API_KEY>',
});

async function streamAudio(text) {
  const stream = await PlayHT.stream('All human wisdom is summed up in these two words: Wait and hope.', { voiceEngine: 'PlayDialog' });
  stream.on('data', (chunk) => {
    // Do whatever you want with the stream, you could save it to a file, stream it in realtime to the browser or app, or to a telephony system
    fs.appendFileSync('output.mp3', chunk);
  });
  return stream;
}
```

```curl
curl --request POST \
     --url https://api.play.ht/api/v2/tts/stream \
     --header 'X-USER-ID: <YOUR_USER_ID>' \
     --header 'AUTHORIZATION: <YOUR_API_KEY>' \
     --header 'accept: audio/mpeg' \
     --header 'content-type: application/json' \
     --data '
{
  "text": "Hello from a realistic voice.",
  "voice_engine": "PlayDialog",
  "voice": "s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json",
  "output_format": "mp3"
}
' --output result.mp3
```

## 4. Learn more

### Input Streaming with LLMs

Our API supports Input streaming to make it seamless to integrate with LLMs like chatGPT, [check this guide to see an example of how to use it](https://docs.play.ht/v2.3/docs/input-and-output-streaming-with-chatgpt-or-any-llm).

### Techniques to guarantee the lowest latency

[Check this guide](https://docs.play.ht/v2.3/docs/techniques-to-guarantee-the-lowest-latency-1) for some techniques to keep in mind when trying to achieve the lowest latency.

### Audio streaming with Twilio

[Follow this guide](https://docs.play.ht/v2.3/docs/streaming-with-twilio-for-phone-based-ai-voice-interactions) for integrating realtime audio streaming with Twilio for over the phone conversations.

### Instant Voice Cloning

You can clone any voice instantly across languages with only 30 seconds of speech, try it easily in our [API Playground](https://play.ht/playground), or [through the API here](https://docs.play.ht/reference/api-create-instant-voice-clone).