メインコンテンツへスキップ
POST
/
voice-changer
/
sse
Voice Changer (SSE)
curl --request POST \
  --url https://api.cartesia.ai/voice-changer/sse \
  --header 'Cartesia-Version: <cartesia-version>' \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form clip='@example-file' \
  --form 'voice[id]=<string>' \
  --form 'output_format[sample_rate]=123' \
  --form 'output_format[bit_rate]=123'
{
  "done": false,
  "status_code": 206,
  "step_time": 123,
  "data": "aSDinaTvuI8gbWludGxpZnk=",
  "sample_rate": 44100
}

承認

X-API-Key
string
header
必須

ヘッダー

Cartesia-Version
enum<string>
必須

API version header.

利用可能なオプション:
2024-11-13
:

"2024-11-13"

ボディ

multipart/form-data
clip
file

Supported audio formats: flac, mp3, mpeg, mpga, oga, ogg, wav, webm

voice[id]
string
output_format[container]
enum<string>
利用可能なオプション:
raw,
wav,
mp3
output_format[sample_rate]
integer
output_format[encoding]
enum<string> | null

Required for raw and wav containers.

利用可能なオプション:
pcm_f32le,
pcm_s16le,
pcm_mulaw,
pcm_alaw
output_format[bit_rate]
integer | null

Required for mp3 containers.

レスポンス

200 - text/event-stream

Server-sent events stream. Each frame is data: <json>\n\n where the JSON payload matches VoiceChangerSSEEvent.

Audio data chunk.

status_code
enum<integer>
必須

HTTP-style status code. Always 206 for chunk events.

利用可能なオプション:
206
done
enum<boolean>
必須

Whether this is the final event for the request. Always false for chunk events.

利用可能なオプション:
false
data
string
必須

Base64-encoded audio data.

sample_rate
integer
必須

The sample rate of the audio in Hz.

step_time
number
必須

Server-side processing time for this chunk in milliseconds.