# Hear a voice before assigning it

> POST /voices/preview. HeyRik API parameters and documented request and response examples.

Source: https://www.heyrik.com/docs/api-reference/voices/post-voices-preview-hear-a-voice-before-assigning-it

POST https://server.heyrik.com/api/v1/voices/preview

## Headers

Authorization: Bearer $HEYRIK_API_KEY (required). Keep your key on your server.

## Parameters

- voice_id (string, required): Library or cloned voice id to speak with.
- text (string): What to say. Defaults to a sample in the voice's own language.

## Notes

Returns audio bytes (audio/mpeg). Add ?url=1 to get a playable URL instead.

## Request example

```sh
curl -X POST https://server.heyrik.com/api/v1/voices/preview \
  -H "Authorization: Bearer $HEYRIK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "voice_id": "vx_9f2a1c30", "text": "Hello, this is a preview." }'
```
