curl --request POST \
--url 'https://api.elkapi.com/v1/audio/speech' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
}'
import requests
url = "https://api.elkapi.com/v1/audio/speech"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/audio/speech";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
"string"
네이티브 OpenAI 형식
텍스트 음성 변환
- 텍스트를 오디오로 변환합니다
POST
/
v1
/
audio
/
speech
curl --request POST \
--url 'https://api.elkapi.com/v1/audio/speech' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
}'
import requests
url = "https://api.elkapi.com/v1/audio/speech"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/audio/speech";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
"string"
curl --request POST \
--url 'https://api.elkapi.com/v1/audio/speech' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
}'
import requests
url = "https://api.elkapi.com/v1/audio/speech"
headers = {
"Authorization": "Bearer <token>"
}
headers["Content-Type"] = "application/json"
payload = {
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
const url = "https://api.elkapi.com/v1/audio/speech";
const headers = {
"Authorization": "Bearer <token>"
};
headers["Content-Type"] = "application/json";
const payload = {
"model": "tts-1",
"input": "오늘 날씨가 정말 좋아 산책하기에 좋습니다.",
"voice": "alloy",
"response_format": "mp3"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(payload)
});
console.log(await response.json());
"string"
Authorizations
string
필수
모든 엔드포인트는 Bearer Token 인증이 필요합니다.요청 헤더에 추가하세요:
Authorization: Bearer YOUR_API_KEY
Body
string
기본값:"tts-1"
필수
예시:
tts-1string
필수
변환할 텍스트
string
필수
허용 값:
alloy, echo, fable, onyx, nova, shimmerstring
기본값:"mp3"
허용 값:
mp3, opus, aac, flac, wav, pcmnumber
기본값:"1"
⌘I