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 は 64 文字の小文字16進数で、任意で 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"]
}
}
このページは役に立ちましたか?

