> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# 音声プレビューから新しい音声を作成

POST https://api.elevenlabs.io/v1/text-to-voice
Content-Type: application/json

以前に生成した音声プレビューから音声を作成します。このエンドポイントは、POST /v1/text-to-voice/designまたはPOST /v1/text-to-voice/:voice_id/remixを使用してgenerated_voice_idを取得した後に呼び出してください。

Reference: https://elevenlabs.io/docs/api-reference/text-to-voice/create

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Body (application/json)

This endpoint expects a Body_Create_a_new_voice_from_voice_preview_v1_text_to_voice_post.

- `voice_name` (string, required) — 作成した音声に使用する名前。
- `voice_description` (string, required) — 作成する音声に使用する説明。
- `generated_voice_id` (string, required) — 作成するgenerated_voice_id。POST /v1/text-to-voice/design、POST /v1/text-to-voice/:voice_id/remix、またはプレビュー生成時のレスポンスヘッダーから取得します。
- `labels` (map from string to string, optional, nullable) — 作成した音声に追加する任意のメタデータ。デフォルトはNoneです。
- `played_not_selected_voice_ids` (list of string, optional, nullable) — ユーザーが再生したものの選択しなかった音声IDのリスト。RLHFに使用します。

## Response

### 200

成功レスポンス。

- `voice_id` (string, required) — 音声のID。
- `name` (string, optional) — 音声の名前。
- `samples` (list of SampleResponseModel, optional, nullable) — 音声に関連付けられたサンプルのリスト。
- `category` (enum, optional) — 音声のカテゴリ。
  - Allowed values: `generated`, `cloned`, `premade`, `professional`, `famous`, `high_quality`
- `fine_tuning` (FineTuningResponseModel, optional, nullable) — 音声の微調整情報。
- `labels` (map from string to string, optional) — 音声に関連付けられたラベルです。
- `description` (string, optional, nullable) — 音声の説明。
- `preview_url` (string, optional, nullable) — 音声のプレビューURL。
- `available_for_tiers` (list of string, optional) — その音声を利用できるティアです。
- `settings` (VoiceSettingsResponseModel, optional, nullable) — 音声の設定。
- `sharing` (VoiceSharingResponseModel, optional, nullable) — 音声の共有情報。
- `high_quality_base_model_ids` (list of string, optional) — 高品質音声用のベースモデルID。
- `verified_languages` (list of VerifiedVoiceLanguageResponseModel, optional, nullable) — 音声で検証済みの言語です。
- `collection_ids` (list of string, optional, nullable) — この音声が属するコレクションのID。
- `safety_control` (enum, optional, nullable) — 音声のセーフティ制御。
  - Allowed values: `NONE`, `BAN`, `CAPTCHA`, `ENTERPRISE_BAN`, `ENTERPRISE_CAPTCHA`
- `voice_verification` (VoiceVerificationResponseModel, optional, nullable) — 音声の音声検証です。
- `permission_on_resource` (string, optional, nullable) — 音声リソースに対する権限。
- `is_owner` (boolean, optional, nullable) — 音声がユーザーによって所有されているかどうか。
- `is_legacy` (boolean, optional, default: false) — 音声がレガシーかどうか。
- `is_mixed` (boolean, optional, default: false) — 音声がミックスされているかどうか。
- `favorited_at_unix` (integer, optional, nullable) — 音声がお気に入りとしてマークされたUnix時刻のタイムスタンプ。
- `created_at_unix` (integer, optional, nullable) — Unix時刻で表した音声の作成時刻。
- `is_bookmarked` (boolean, optional, nullable) — 現在のユーザーがその音声をブックマークしているかどうか。コミュニティ（ライブラリからコピーした）音声にのみ関連します。
- `recording_quality` (enum, optional, nullable) — レビューパイプラインによって判断された音声の録音品質。
  - Allowed values: `studio`, `good`, `ok`, `poor`, `bad`
- `labelling_status` (enum, optional, nullable) — 音声のレビューパイプラインステータス。
  - Allowed values: `in_review`, `review_complete`
- `recording_quality_reason` (string, optional, nullable) — レビューパイプラインによって判断された録音品質評価の理由。

## Errors

### 409 Conflict Error

このプレビューの生成はすでに進行中です。リクエストを再試行してください。

- `any`

### 422 Unprocessable Entity Error

検証エラー

- `detail` (list of ValidationError, optional)

## Types

### SampleResponseModel

- `sample_id` (string, optional) — サンプルのID。
- `file_name` (string, optional) — サンプルファイルの名前。
- `mime_type` (string, optional) — サンプルファイルのMIMEタイプ。
- `size_bytes` (integer, optional) — サンプルファイルのサイズ（バイト）。
- `hash` (string, optional) — サンプルファイルのハッシュ。
- `duration_secs` (double, optional, nullable)
- `remove_background_noise` (boolean, optional, nullable)
- `has_isolated_audio` (boolean, optional, nullable)
- `has_isolated_audio_preview` (boolean, optional, nullable)
- `speaker_separation` (SpeakerSeparationResponseModel, optional, nullable)
- `trim_start` (integer, optional, nullable)
- `trim_end` (integer, optional, nullable)

### FineTuningResponseModel

- `is_allowed_to_fine_tune` (boolean, optional) — ユーザーに音声の微調整が許可されているかどうか。
- `state` (map from string to enum, optional) — 各モデルの微調整プロセスの状態。
  - Allowed values: `not_started`, `queued`, `fine_tuning`, `fine_tuned`, `failed`, `delayed`
- `verification_failures` (list of string, optional) — 微調整プロセスでの検証失敗のリスト。
- `verification_attempts_count` (integer, optional) — 微調整プロセスでの検証試行回数。
- `manual_verification_requested` (boolean, optional) — 微調整プロセスに対して手動検証がリクエストされたかどうか。
- `language` (string, optional, nullable) — 微調整プロセスの言語。
- `progress` (map from string to double, optional, nullable) — 微調整プロセスの進捗。
- `message` (map from string to string, optional, nullable) — 微調整プロセスのメッセージ。
- `dataset_duration_seconds` (double, optional, nullable) — データセットの長さ（秒）。
- `verification_attempts` (list of VerificationAttemptResponseModel, optional, nullable) — 検証試行回数。
- `slice_ids` (list of string, optional, nullable) — スライスIDのリスト。
- `manual_verification` (ManualVerificationResponseModel, optional, nullable) — 微調整プロセスの手動検証。
- `max_verification_attempts` (integer, optional, nullable) — 検証試行の最大回数。
- `next_max_verification_attempts_reset_unix_ms` (integer, optional, nullable) — 次の最大検証試行回数のリセット時刻（Unixミリ秒）。
- `finetuning_state` (any, optional)

### VoiceSettingsResponseModel

- `stability` (double, optional, nullable, default: 0.5) — 音声の安定性と各生成間のランダム性を決定します。値が低いほど、音声の感情表現の幅が広がります。値が高いほど、感情表現が限られた単調な音声になる場合があります。
- `use_speaker_boost` (boolean, optional, nullable, default: true) — この設定は元の話者との類似性を高めます。この設定を使用すると計算負荷がやや高くなり、その結果レイテンシーが増加します。
- `similarity_boost` (double, optional, nullable, default: 0.75) — AIが元の音声を再現する際に、どの程度忠実に元の音声に従うかを決定します。
- `style` (double, optional, nullable, default: 0) — 音声のスタイル強調度を決定します。この設定では、元の話者のスタイルを強調します。追加の計算リソースを消費するため、0以外に設定するとレイテンシーが増加する場合があります。
- `speed` (double, optional, nullable, default: 1) — 音声の速度を調整します。1.0がデフォルトの速度で、1.0未満の値では発話が遅くなり、1.0を超える値では速くなります。

### VoiceSharingResponseModel

- `status` (enum, optional) — 音声共有のステータス。
  - Allowed values: `enabled`, `disabled`, `copied`, `copied_disabled`
- `history_item_sample_id` (string, optional, nullable) — 履歴項目のサンプルID。
- `date_unix` (integer, optional) — Unix時刻で表した音声共有日。
- `whitelisted_emails` (list of string, optional) — 許可リストに登録されたメールアドレスの一覧。
- `public_owner_id` (string, optional) — 公開オーナーのID。
- `original_voice_id` (string, optional) — 元の音声のID。
- `financial_rewards_enabled` (boolean, optional) — 金銭的報酬が有効かどうか。
- `free_users_allowed` (boolean, optional) — 無料ユーザーを許可するかどうか。
- `live_moderation_enabled` (boolean, optional) — ライブモデレーションが有効かどうか。
- `rate` (double, optional, nullable) — 音声共有のレート。
- `fiat_rate` (double, optional, nullable) — 音声共有のレート（1,000クレジットあたりの米ドル）。
- `notice_period` (integer, optional) — 音声共有の通知期間。
- `disable_at_unix` (integer, optional, nullable) — Unix時刻で表した音声共有日。
- `voice_mixing_allowed` (boolean, optional) — 音声ミキシングを許可するかどうか。
- `featured` (boolean, optional) — 音声が注目の音声かどうか。
- `category` (enum, optional) — 音声のカテゴリ。
  - Allowed values: `generated`, `cloned`, `premade`, `professional`, `famous`, `high_quality`
- `reader_app_enabled` (boolean, optional, nullable) — Reader Appが有効かどうか。
- `image_url` (string, optional, nullable) — 音声の画像URL。
- `ban_reason` (string, optional, nullable) — 音声の禁止理由。
- `liked_by_count` (integer, optional) — この音声のいいね数。
- `cloned_by_count` (integer, optional) — この音声のクローン数。
- `name` (string, optional) — 音声の名前。
- `description` (string, optional, nullable) — 音声の説明。
- `labels` (map from string to string, optional) — 音声のラベル。
- `review_status` (enum, optional) — 音声のレビューステータス。
  - Allowed values: `not_requested`, `pending`, `declined`, `allowed`, `allowed_with_changes`
- `review_message` (string, optional, nullable) — 音声のレビューメッセージ。
- `enabled_in_library` (boolean, optional) — 音声がライブラリで有効かどうか。
- `instagram_username` (string, optional, nullable) — 音声のInstagramユーザー名。
- `twitter_username` (string, optional, nullable) — 音声のTwitter/Xユーザー名です。
- `youtube_username` (string, optional, nullable) — 音声のYouTubeユーザー名です。
- `tiktok_username` (string, optional, nullable) — 音声のTikTokユーザー名です。
- `moderation_check` (VoiceSharingModerationCheckResponseModel, optional, nullable) — 音声のモデレーションチェック。
- `reader_restricted_on` (list of ReaderResourceResponseModel, optional, nullable) — 音声でのReader制限の有効化状態。

### VerifiedVoiceLanguageResponseModel

- `language` (string, required) — 音声の言語。
- `model_id` (string, required) — 音声のモデルIDです。
- `accent` (string, optional, nullable) — 該当する場合、音声のアクセントです。
- `locale` (string, optional, nullable) — 該当する場合、音声のロケールです。
- `preview_url` (string, optional, nullable) — 該当する場合、音声のプレビューURLです。

### VoiceVerificationResponseModel

- `requires_verification` (boolean, required) — 音声に検証が必要かどうか。
- `is_verified` (boolean, required) — 音声が検証済みかどうか。
- `verification_failures` (list of string, required) — 検証失敗のリスト。
- `verification_attempts_count` (integer, required) — 検証試行回数。
- `language` (string, optional, nullable) — 音声の言語。
- `verification_attempts` (list of VerificationAttemptResponseModel, optional, nullable) — 検証が試行された回数です。

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### SpeakerSeparationResponseModel

- `voice_id` (string, required) — 音声のID。
- `sample_id` (string, required) — サンプルのID。
- `status` (enum, required) — 話者分離のステータス。
  - Allowed values: `not_started`, `pending`, `completed`, `failed`
- `speakers` (map from string to SpeakerResponseModel, optional, nullable) — サンプルの話者。
- `selected_speaker_ids` (list of string, optional, nullable) — 選択した話者のID。

### VerificationAttemptResponseModel

- `text` (string, required) — 検証試行のテキスト。
- `date_unix` (integer, required) — Unix時刻で表した確認試行日。
- `accepted` (boolean, required) — 検証試行が承認されたかどうか。
- `similarity` (double, required) — 検証試行の類似性。
- `levenshtein_distance` (double, required) — 検証試行のレーベンシュタイン距離。
- `recording` (RecordingResponseModel, optional, nullable) — 検証試行の録音。

### ManualVerificationResponseModel

- `extra_text` (string, required) — 手動確認の追加テキスト。
- `request_time_unix` (integer, required) — Unix時刻で表した手動確認の日付。
- `files` (list of ManualVerificationFileResponseModel, required) — 手動検証用のファイル。

### VoiceSharingModerationCheckResponseModel

- `date_checked_unix` (integer, optional, nullable) — Unix時刻で表したモデレーションチェックの実行日。
- `name_value` (string, optional, nullable) — 音声の名前の値。
- `name_check` (boolean, optional, nullable) — 名前チェックが成功したかどうか。
- `description_value` (string, optional, nullable) — 音声の説明値。
- `description_check` (boolean, optional, nullable) — 説明チェックが成功したかどうか。
- `sample_ids` (list of string, optional, nullable) — サンプルIDの一覧。
- `sample_checks` (list of double, optional, nullable) — サンプルチェックの一覧。
- `captcha_ids` (list of string, optional, nullable) — captcha IDのリストです。
- `captcha_checks` (list of double, optional, nullable) — CAPTCHAチェック値のリストです。

### ReaderResourceResponseModel

- `resource_type` (enum, required) — リソースのタイプです。
  - Allowed values: `read`, `collection`
- `resource_id` (string, required) — リソースのID。

### ValidationErrorLocItems

### SpeakerResponseModel

- `speaker_id` (string, required) — 話者のID。
- `duration_secs` (double, required) — 話者セグメントの長さ（秒）。
- `utterances` (list of UtteranceResponseModel, optional, nullable) — 話者の発話です。

### RecordingResponseModel

- `recording_id` (string, required) — 録音のID。
- `mime_type` (string, required) — 録音のMIMEタイプ。
- `size_bytes` (integer, required) — 録音サイズ（バイト）。
- `upload_date_unix` (integer, required) — Unix時刻で表した録音日。
- `transcription` (string, required) — 録音の文字起こしです。

### ManualVerificationFileResponseModel

- `file_id` (string, required) — ファイルのID。
- `file_name` (string, required) — ファイルの名前。
- `mime_type` (string, required) — ファイルのMIMEタイプ。
- `size_bytes` (integer, required) — ファイルサイズ（バイト）。
- `upload_date_unix` (integer, required) — Unix時刻で表したファイルの日付。

### UtteranceResponseModel

- `start` (double, required) — 発話の開始時刻（秒）。
- `end` (double, required) — 発話の終了時刻（秒）。

## Examples

**Request**

```json
{
  "voice_name": "Sassy squeaky mouse",
  "voice_description": "A sassy squeaky mouse",
  "generated_voice_id": "37HceQefKmEi3bGovXjL"
}
```

**Response**

```json
{
  "voice_id": "21m00Tcm4TlvDq8ikWAM",
  "name": "Rachel",
  "category": "professional",
  "fine_tuning": {
    "is_allowed_to_fine_tune": true,
    "state": {
      "eleven_multilingual_v2": "fine_tuned"
    },
    "verification_failures": [],
    "verification_attempts_count": 2,
    "manual_verification_requested": false
  },
  "labels": {
    "accent": "American",
    "age": "middle-aged",
    "description": "expressive",
    "gender": "female",
    "use_case": "social media"
  },
  "description": "A warm, expressive voice with a touch of humor.",
  "preview_url": "https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",
  "available_for_tiers": [
    "creator",
    "enterprise"
  ],
  "settings": {
    "stability": 1,
    "use_speaker_boost": true,
    "similarity_boost": 1,
    "style": 0,
    "speed": 1
  },
  "sharing": {
    "status": "enabled",
    "history_item_sample_id": "DCwhRBWXzGAHq8TQ4Fs18",
    "date_unix": 1714204800,
    "whitelisted_emails": [
      "example@example.com"
    ],
    "public_owner_id": "DCwhRBWXzGAHq8TQ4Fs18",
    "original_voice_id": "DCwhRBWXzGAHq8TQ4Fs18",
    "financial_rewards_enabled": true,
    "free_users_allowed": true,
    "live_moderation_enabled": true,
    "rate": 0.05,
    "notice_period": 30,
    "disable_at_unix": 1714204800,
    "voice_mixing_allowed": false,
    "featured": true,
    "category": "professional",
    "reader_app_enabled": true,
    "liked_by_count": 100,
    "cloned_by_count": 50,
    "name": "Rachel",
    "description": "A female voice with a soft and friendly tone.",
    "labels": {
      "accent": "American",
      "gender": "female"
    },
    "review_status": "allowed",
    "enabled_in_library": true,
    "moderation_check": {
      "date_checked_unix": 1714204800,
      "name_value": "Rachel",
      "name_check": true,
      "description_value": "A female voice with a soft and friendly tone.",
      "description_check": true,
      "sample_ids": [
        "sample1",
        "sample2"
      ],
      "sample_checks": [
        0.95,
        0.98
      ],
      "captcha_ids": [
        "captcha1",
        "captcha2"
      ],
      "captcha_checks": [
        0.95,
        0.98
      ]
    },
    "reader_restricted_on": [
      {
        "resource_type": "read",
        "resource_id": "FCwhRBWXzGAHq8TQ4Fs18"
      }
    ]
  },
  "high_quality_base_model_ids": [
    "eleven_v2_flash",
    "eleven_flash_v2",
    "eleven_turbo_v2_5",
    "eleven_multilingual_v2",
    "eleven_v2_5_flash",
    "eleven_flash_v2_5",
    "eleven_turbo_v2"
  ],
  "verified_languages": [
    {
      "language": "en",
      "model_id": "eleven_multilingual_v2",
      "accent": "american",
      "locale": "en-US",
      "preview_url": "https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3"
    }
  ],
  "voice_verification": {
    "requires_verification": false,
    "is_verified": true,
    "verification_failures": [],
    "verification_attempts_count": 0,
    "language": "en",
    "verification_attempts": [
      {
        "text": "Hello, how are you?",
        "date_unix": 1714204800,
        "accepted": true,
        "similarity": 0.95,
        "levenshtein_distance": 2,
        "recording": {
          "recording_id": "CwhRBWXzGAHq8TQ4Fs17",
          "mime_type": "audio/mpeg",
          "size_bytes": 1000000,
          "upload_date_unix": 1714204800,
          "transcription": "Hello, how are you?"
        }
      }
    ]
  },
  "is_owner": false,
  "is_legacy": false,
  "is_mixed": false
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/text-to-voice"

payload = {
    "voice_name": "Sassy squeaky mouse",
    "voice_description": "A sassy squeaky mouse",
    "generated_voice_id": "37HceQefKmEi3bGovXjL"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/text-to-voice';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"voice_name":"Sassy squeaky mouse","voice_description":"A sassy squeaky mouse","generated_voice_id":"37HceQefKmEi3bGovXjL"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/text-to-voice"

	payload := strings.NewReader("{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/text-to-voice")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.elevenlabs.io/v1/text-to-voice")
  .header("Content-Type", "application/json")
  .body("{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.elevenlabs.io/v1/text-to-voice', [
  'body' => '{
  "voice_name": "Sassy squeaky mouse",
  "voice_description": "A sassy squeaky mouse",
  "generated_voice_id": "37HceQefKmEi3bGovXjL"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/text-to-voice");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "voice_name": "Sassy squeaky mouse",
  "voice_description": "A sassy squeaky mouse",
  "generated_voice_id": "37HceQefKmEi3bGovXjL"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/text-to-voice")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```