POST
/
sse
/
speak
/
{lang_code}
curl --request POST \
  --url https://eu-west-1.api.neuphonic.com/sse/speak/{lang_code} \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "text": "<string>",
  "voice_id": "<string>",
  "sampling_rate": "<any>",
  "speed": "<any>"
}'
{
  "event": "message",
  "data": {
    "status_code": "200",
    "data": {
      "audio": "<string>",
      "text": "<string>",
      "sampling_rate": "<any>"
    }
  }
}

Authorizations

X-API-KEY
string
header
required

API Key Authentication. Get your API key from the Neuphonic website.

Path Parameters

lang_code
string
required

The language code for the text-to-speech (TTS) generation.

Body

application/json
text
string

The input text for the TTS generation.

voice_id
string

The ID of the voice to use for the TTS generation.

sampling_rate
any
speed
any

Response

200
application/json
Successful Response
event
string
default:message

The event type for the SSE stream.

data
object

The data payload for the SSE stream.