curl --request POST 'https://api.voicecheap.ai/v1/actions/tts_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"historyId":"722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d"}'
const input = {
historyId: '722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/tts_get', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/tts_get",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"historyId": "722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"historyId": "722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d",
"text": "Hello world.",
"spokenText": "Hello world.",
"voice": "933563129e564b19a115bedd57b7406a",
"voiceName": "Sarah",
"voiceSource": "catalog",
"inputType": "text",
"instructionPreset": "narrator",
"instructions": "Speak clearly and leave a short pause at the end.",
"speed": 1,
"sourceFileName": "launch-script.txt",
"characterCount": 12,
"durationSeconds": 1.5,
"previewEndIndex": null,
"createdAt": 1792152000000,
"updatedAt": 1792152000000,
"status": "success",
"audioUrl": "https://files.example.com/launch-script.mp3",
"wordAlignment": [
{
"text": "Hello",
"startSeconds": 0,
"endSeconds": 0.6,
"sourceStartCharacterIndex": 0,
"sourceEndCharacterIndex": 5
},
{
"text": "world.",
"startSeconds": 0.7,
"endSeconds": 1.4,
"sourceStartCharacterIndex": 6,
"sourceEndCharacterIndex": 12
}
]
}
}
텍스트 음성 변환
생성된 음성 조회
대본, 발화 설정, 임시 오디오 URL 및 사용 가능한 단어 정렬을 포함하여 본인 소유의 음성 생성물을 조회합니다.
POST
/
v1
/
actions
/
tts_get
curl --request POST 'https://api.voicecheap.ai/v1/actions/tts_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"historyId":"722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d"}'
const input = {
historyId: '722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/tts_get', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/tts_get",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"historyId": "722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"historyId": "722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d",
"text": "Hello world.",
"spokenText": "Hello world.",
"voice": "933563129e564b19a115bedd57b7406a",
"voiceName": "Sarah",
"voiceSource": "catalog",
"inputType": "text",
"instructionPreset": "narrator",
"instructions": "Speak clearly and leave a short pause at the end.",
"speed": 1,
"sourceFileName": "launch-script.txt",
"characterCount": 12,
"durationSeconds": 1.5,
"previewEndIndex": null,
"createdAt": 1792152000000,
"updatedAt": 1792152000000,
"status": "success",
"audioUrl": "https://files.example.com/launch-script.mp3",
"wordAlignment": [
{
"text": "Hello",
"startSeconds": 0,
"endSeconds": 0.6,
"sourceStartCharacterIndex": 0,
"sourceEndCharacterIndex": 5
},
{
"text": "world.",
"startSeconds": 0.7,
"endSeconds": 1.4,
"sourceStartCharacterIndex": 6,
"sourceEndCharacterIndex": 12
}
]
}
}
대본, 발화 설정, 임시 오디오 URL 및 사용 가능한 단어 정렬을 포함하여 본인 소유의 음성 생성물을 조회합니다.
필요한 권한:
POST https://api.voicecheap.ai/v1/actions/tts_get
인증 및 권한
string
필수
이 헤더에 VoiceCheap API 키를 전달하세요. 동일한 API 키를 사용하는 Authorization: Bearer도 지원합니다. OAuth 액세스 토큰은 MCP에서만 허용되며, 이
REST 엔드포인트에서는 사용할 수 없습니다.
tts:read.
활성 유료 구독이 필요합니다. 권한은 팀 역할, 리소스 소유권, 미디어 크레딧 또는 요금제 한도를 변경하지 않습니다.
매개변수
string
필수
tts_generate 또는 tts_list가 반환한 이력 ID입니다.패턴:
^(free-)?[0-9a-f]{64}$.전체 입력 스키마
전체 입력 스키마
아래 JSON Schema는 검색을 통해 제공되는 정확한 필드 이름, 중첩 유형, 기본값, 범위 및 허용값을 유지합니다. 추가적인 필드 간 규칙은 작업 참고 사항에 나와 있습니다.
{
"type": "object",
"properties": {
"historyId": {
"type": "string",
"pattern": "^(free-)?[0-9a-f]{64}$",
"description": "History ID returned by tts_generate or tts_list."
}
},
"required": ["historyId"],
"additionalProperties": false
}
요청 예제
예제의 리소스 식별자와 미디어 키를 계정에서 반환된 값으로 바꾸세요. 동일한 변경 작업을 재시도할 때는 요청 식별자를 유지하세요.curl --request POST 'https://api.voicecheap.ai/v1/actions/tts_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"historyId":"722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d"}'
const input = {
historyId: '722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/tts_get', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/tts_get",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"historyId": "722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
응답
성공한 첫 실행은 작업 결과를 data 아래에 포함하여 HTTP 200을 반환합니다. 재전송 시에는 저장된 요청 상태를 대신 반환할 수 있습니다. 예제는 지원되는 응답 중 하나를 보여주며 모든 선택 필드를 포함하지는 않습니다. 소유한 음성 기록의 상세 정보, 편집용 및 실제 발화용 전체 스크립트, 발화 설정, 임시 재생 URL 및 사용 가능한 단어 타임스탬프입니다.{
"data": {
"historyId": "722c80c6412edd4c3dcd625061e1c1feafbb0d54274d95fd8b5ca047f8cdd23d",
"text": "Hello world.",
"spokenText": "Hello world.",
"voice": "933563129e564b19a115bedd57b7406a",
"voiceName": "Sarah",
"voiceSource": "catalog",
"inputType": "text",
"instructionPreset": "narrator",
"instructions": "Speak clearly and leave a short pause at the end.",
"speed": 1,
"sourceFileName": "launch-script.txt",
"characterCount": 12,
"durationSeconds": 1.5,
"previewEndIndex": null,
"createdAt": 1792152000000,
"updatedAt": 1792152000000,
"status": "success",
"audioUrl": "https://files.example.com/launch-script.mp3",
"wordAlignment": [
{
"text": "Hello",
"startSeconds": 0,
"endSeconds": 0.6,
"sourceStartCharacterIndex": 0,
"sourceEndCharacterIndex": 5
},
{
"text": "world.",
"startSeconds": 0.7,
"endSeconds": 1.4,
"sourceStartCharacterIndex": 6,
"sourceEndCharacterIndex": 12
}
]
}
}
결과 필드
| 필드 | 설명 |
|---|---|
data.historyId | 본인 소유 음성 기록 ID로, 64자의 소문자 16진수 문자입니다. 앱 미리보기의 경우 선택적으로 free- 접두사가 붙습니다. |
data.voice | 원래 TTS 선택 ID이며, 저장된 사용자 지정 음성의 경우 clone:<UUID>를 포함합니다. |
data.voiceName | 선택한 음성에 저장된 표시 이름이며 선택 사항입니다. |
data.voiceSource | 선택적 음성 소스이며 catalog 또는 clone입니다. |
data.inputType | 원본 입력 유형은 text 또는 pdf입니다. |
data.instructionPreset | 저장된 발화 프리셋입니다. |
data.sourceFileName | 생성 시 제공된 선택적 원본 파일명입니다. |
data.characterCount | 이 음성 생성에 대해 기록된 문자 수입니다. |
data.durationSeconds | 오디오 길이(초 단위)입니다. |
data.createdAt | 생성 시각으로, 밀리초 단위 Unix 타임스탬프입니다. |
data.updatedAt | 밀리초 단위 Unix 타임스탬프로 표시한 마지막 수정 시점입니다. |
data.status | 저장된 성공 음성 항목은 success를 사용하며, tts_generate는 생성 결과에서 completed를 사용합니다. |
data.text | 저장된 전체 대본이며 편집 가능합니다. 지원되는 발화 제어 태그를 포함합니다. |
data.spokenText | 지원되는 발화 제어 태그를 제거한 저장 대본입니다. |
data.instructions | 저장된 맞춤 발화 지침이며, 없으면 빈 값입니다. |
data.speed | 저장된 재생 발화 속도이며, 이전 기록에 값이 없으면 1입니다. |
data.previewEndIndex | 사용 가능한 미리 보기의 문자 경계이며, 전체 오디오의 경우 null입니다. |
data.audioUrl | 재생 가능한 임시 오디오 URL입니다. |
data.wordAlignment | 단어 타임스탬프이며, 정렬 정보를 사용할 수 없으면 null입니다. |
data.wordAlignment[].text | 정렬된 단어 텍스트입니다. |
data.wordAlignment[].startSeconds | 단어의 시작 시간이며, 단위는 초입니다. |
data.wordAlignment[].endSeconds | 단어의 종료 시각으로, 초 단위입니다. |
data.wordAlignment[].sourceStartCharacterIndex | 발화 제어 태그를 제거한 후 spokenText에서의 시작 문자 인덱스입니다. |
data.wordAlignment[].sourceEndCharacterIndex | 발화 제어 태그를 제거한 후 spokenText에서의 끝 문자 인덱스입니다. |
작업 참고 사항
- historyId는 소문자 16진수 64자여야 하며, 선택적으로 free- 접두사를 붙일 수 있습니다. tts_generate 또는 tts_list가 반환한 식별자를 사용하세요.
- voiceName, voiceSource, sourceFileName과 같은 이전 기록의 선택적 속성은 생략될 수 있습니다. instructions가 없으면 기본값은 빈 문자열, speed가 없으면 1, previewEndIndex가 없으면 null입니다.
- wordAlignment는 null일 수 있습니다. 이 조회는 기존 정렬을 불러옵니다. 타임스탬프를 준비하려면 tts_align을 사용하세요.
- wordAlignment의 원본 문자 인덱스는 발화 제어 태그가 제거된 spokenText를 참조합니다.
- audioUrl은 임시 URL입니다. 새 재생 URL을 받으려면 tts_get을 다시 호출하고, 다운로드 링크를 받으려면 tts_download를 호출하세요.
- 음성 합성 기록과 사용자 지정 음성은 인증된 계정에 속합니다. 팀 결제를 사용해도 다른 멤버의 음성 합성 결과나 음성에 접근할 수 없습니다.
사용량
성공한 호출마다 월간 API/MCP 호출 1회가 차감됩니다. 미디어 크레딧과 해당 작업의 생성 허용량도 적용됩니다.오류
| HTTP 상태 | 코드 | 의미 또는 복구 방법 |
|---|---|---|
| 400 | CREDENTIAL_IN_QUERY | 자격 증명이 access_token 또는 api_key 쿼리 매개변수로 제공되었습니다. 자격 증명은 헤더로 보내세요. |
| 400 | VALIDATION_ERROR | 입력이 액션 스키마와 일치하지 않습니다. 필드 오류는 details를 확인하세요. |
| 401 | API_KEY_EXPIRED | API 키가 만료되었습니다. |
| 401 | INVALID_API_KEY | 유효하고 만료되지 않은 API 키를 제공하세요. |
| 401 | INVALID_CREDENTIAL | Authorization 헤더의 형식이 잘못되었거나 x-api-key와 충돌합니다. |
| 401 | MISSING_CREDENTIAL | 사용 가능한 헤더 자격 증명이 전달되지 않았거나 4096자를 초과했습니다. |
| 401 | USER_NOT_FOUND | 이 자격 증명에 연결된 계정이 더 이상 존재하지 않습니다. |
| 403 | AMBIGUOUS_TEAM_API_KEY | 이 자격 증명의 사용자가 둘 이상의 팀에 속해 있어 청구 컨텍스트가 모호합니다. |
| 403 | INSUFFICIENT_SCOPE | 필요한 모든 권한을 부여하거나 다른 자격 증명을 사용하세요. |
| 403 | INTEGRATION_PLAN_UNSUPPORTED | 계정의 통합 한도를 확인할 수 없습니다. |
| 403 | SUBSCRIPTION_REQUIRED | 활성 유료 구독을 사용하세요. |
| 403 | TEAM_OWNER_NOT_FOUND | 실제로 적용되는 팀 소유자 계정을 찾을 수 없습니다. |
| 404 | TEXT_TO_SPEECH_HISTORY_NOT_FOUND | 음성 기록 항목이 존재하지 않거나 다른 계정에 속합니다. |
| 429 | INTEGRATION_MONTHLY_LIMIT_REACHED | 월간 한도가 초기화될 때까지 기다리거나 요금제를 변경하세요. |
| 429 | INTEGRATION_RATE_LIMIT_REACHED | Retry-After가 있으면 지정된 시간만큼 기다리고 백오프를 적용하세요. |
| 500 | INTERNAL_ERROR | 변경 작업을 재시도하기로 결정하기 전에 저장된 요청 상태와 리소스 기록을 확인하세요. |
| 503 | SERVER_RESTARTING | 서버가 다시 시작 중입니다. 잠시 후 재시도하고, 변경 작업의 경우 동일한 요청 식별자를 유지하세요. |
{
"code": "INSUFFICIENT_SCOPE",
"message": "This credential does not permit the requested action.",
"status": 403,
"details": {
"requiredScopes": ["tts:read"]
}
}
이 페이지가 도움이 되었나요?

