---
title: Fish Audio 텍스트→음성 | RunAPI
description: 텍스트를 음성으로 변환하는 엔드포인트를 사용하여 동일한 응답에서 결과를 받으세요.
url: https://runapi.ai/ko/docs/api/fish-audio/text-to-speech.md
canonical: https://runapi.ai/ko/docs/api/fish-audio/text-to-speech
locale: ko
---

> HTML 버전: https://runapi.ai/ko/docs/api/fish-audio/text-to-speech
> 에이전트용 사이트 색인: https://runapi.ai/llms.txt

# Fish Audio 텍스트→음성

## 개요

텍스트를 음성으로 변환하는 엔드포인트를 사용하고, 동일한 응답에서 결과를 읽으세요.

### 빠른 시작

1. API 키를 만들고 RUNAPI_API_KEY로 설정합니다.
2. 요청 스키마와 일치하는 본문으로 POST 요청을 전송하세요.
3. 성공 응답 본문에서 결과를 읽습니다.

## 엔드포인트

POST /api/v1/fish_audio/text_to_speech

Base URL: https://runapi.ai

API 버전: v1

인증: Authorization: Bearer YOUR_API_TOKEN

## 지원 모델

현재 가격, 속도 제한 및 상업적 이용 세부 정보는 모델 페이지를 여십시오.

- [s1](https://runapi.ai/ko/models/fish-audio/s1)
- [s2-pro](https://runapi.ai/ko/models/fish-audio/s2-pro)
- [s2.1-pro](https://runapi.ai/ko/models/fish-audio/s2.1-pro)

## 요청 스키마

이 엔드포인트에 선언된 필드만 전송하세요.

### s1

```json
{
  "bitrate_kbps": {
    "default": 128,
    "description": "MP3 비트레이트. WAV 출력에는 허용되지 않습니다.",
    "enum": [
      64,
      128,
      192
    ],
    "type": "integer"
  },
  "model": {
    "description": "모델 슬러그.",
    "required": true,
    "type": "string"
  },
  "output_format": {
    "default": "mp3",
    "description": "출력 오디오 형식.",
    "enum": [
      "mp3",
      "wav"
    ],
    "type": "string"
  },
  "references": {
    "description": "이 요청에 대한 인라인 참조 오디오 샘플.",
    "items": {
      "properties": {
        "audio": {
          "description": "Base64로 인코딩된 원시 오디오 바이트.",
          "required": true,
          "type": "string"
        },
        "text": {
          "description": "참조 오디오의 정확한 트랜스크립트.",
          "required": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "type": "array"
  },
  "sample_rate_hz": {
    "default": 44100,
    "description": "출력 샘플 레이트. MP3는 32000 및 44100 Hz를 지원하며, WAV는 나열된 모든 값을 지원합니다.",
    "enum": [
      8000,
      16000,
      24000,
      32000,
      44100
    ],
    "type": "integer"
  },
  "text": {
    "required": true,
    "type": "string"
  },
  "voice_id": {
    "type": "string"
  }
}
```

### s2-pro

```json
{
  "bitrate_kbps": {
    "default": 128,
    "description": "MP3 비트레이트. WAV 출력에는 허용되지 않습니다.",
    "enum": [
      64,
      128,
      192
    ],
    "type": "integer"
  },
  "model": {
    "description": "모델 슬러그.",
    "required": true,
    "type": "string"
  },
  "output_format": {
    "default": "mp3",
    "description": "출력 오디오 형식.",
    "enum": [
      "mp3",
      "wav"
    ],
    "type": "string"
  },
  "references": {
    "description": "이 요청에 대한 인라인 참조 오디오 샘플.",
    "items": {
      "properties": {
        "audio": {
          "description": "Base64로 인코딩된 원시 오디오 바이트.",
          "required": true,
          "type": "string"
        },
        "text": {
          "description": "참조 오디오의 정확한 트랜스크립트.",
          "required": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "type": "array"
  },
  "sample_rate_hz": {
    "default": 44100,
    "description": "출력 샘플 레이트. MP3는 32000 및 44100 Hz를 지원하며, WAV는 나열된 모든 값을 지원합니다.",
    "enum": [
      8000,
      16000,
      24000,
      32000,
      44100
    ],
    "type": "integer"
  },
  "text": {
    "required": true,
    "type": "string"
  },
  "voice_id": {
    "type": "string"
  }
}
```

### s2.1-pro

```json
{
  "bitrate_kbps": {
    "default": 128,
    "description": "MP3 비트레이트. WAV 출력에는 허용되지 않습니다.",
    "enum": [
      64,
      128,
      192
    ],
    "type": "integer"
  },
  "model": {
    "description": "모델 슬러그.",
    "required": true,
    "type": "string"
  },
  "output_format": {
    "default": "mp3",
    "description": "출력 오디오 형식.",
    "enum": [
      "mp3",
      "wav"
    ],
    "type": "string"
  },
  "references": {
    "description": "이 요청에 대한 인라인 참조 오디오 샘플.",
    "items": {
      "properties": {
        "audio": {
          "description": "Base64로 인코딩된 원시 오디오 바이트.",
          "required": true,
          "type": "string"
        },
        "text": {
          "description": "참조 오디오의 정확한 트랜스크립트.",
          "required": true,
          "type": "string"
        }
      },
      "type": "object"
    },
    "type": "array"
  },
  "sample_rate_hz": {
    "default": 44100,
    "description": "출력 샘플 레이트. MP3는 32000 및 44100 Hz를 지원하며, WAV는 나열된 모든 값을 지원합니다.",
    "enum": [
      8000,
      16000,
      24000,
      32000,
      44100
    ],
    "type": "integer"
  },
  "text": {
    "required": true,
    "type": "string"
  },
  "voice_id": {
    "type": "string"
  }
}
```

#### 조건부 규칙

이 요구 사항은 나열된 모든 조건이 일치할 때 적용됩니다.

- **다음의 경우**: `output_format` = `wav`; **허용되지 않음**: `bitrate_kbps`
- **다음의 경우**: `output_format` = `mp3`
- **다음의 경우**: `output_format` = `{"present" => false}`

## 성공 응답

HTTP 200 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "audios": {
      "items": {
        "properties": {
          "format": {
            "type": "string"
          },
          "mime_type": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "x-runapi-generated-media": true
          }
        },
        "required": [
          "url",
          "format",
          "mime_type",
          "size_bytes"
        ],
        "type": "object",
        "unevaluatedProperties": false
      },
      "type": "array"
    },
    "billing": {
      "properties": {
        "refund": {
          "oneOf": [
            {
              "properties": {
                "refunded_at": {
                  "type": "string"
                }
              },
              "required": [
                "refunded_at"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "reservation": {
          "oneOf": [
            {
              "properties": {
                "amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "amount_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        },
        "settlement": {
          "oneOf": [
            {
              "properties": {
                "amount_micro_cents": {
                  "type": "integer"
                },
                "charged_amount_cents": {
                  "type": "integer"
                }
              },
              "required": [
                "charged_amount_cents",
                "amount_micro_cents"
              ],
              "type": "object",
              "unevaluatedProperties": false
            },
            {
              "enum": [
                null
              ]
            }
          ]
        }
      },
      "required": [
        "reservation",
        "settlement",
        "refund"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    "id": {
      "type": "string"
    },
    "status": {
      "enum": [
        "completed"
      ],
      "type": "string"
    }
  },
  "required": [
    "id",
    "status",
    "audios",
    "billing"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "audios": [
    {
      "format": "mp3",
      "mime_type": "audio/mpeg",
      "size_bytes": 128,
      "url": "https://file.runapi.ai/reference-audio.mp3"
    }
  ],
  "billing": {
    "refund": null,
    "reservation": null,
    "settlement": null
  },
  "id": "tsk_reference_demo",
  "status": "completed"
}
```

## 오류

HTTP 401 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "error": "Authentication required"
}
```

## 오류

HTTP 400 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "사람이 읽을 수 있는 오류 메시지.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "사람이 읽을 수 있는 유효성 검사 요약입니다.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "공개 요청 필드를 키로 하는 유효성 검사 메시지로, 각 필드에 대해 사람이 읽을 수 있는 문자열 배열이 포함됩니다.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### 응답 예시

```json
{
  "error": "model must be one of: s1, s2-pro, s2.1-pro"
}
```

## 오류

HTTP 402 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "error": "Insufficient balance"
}
```

## 오류

HTTP 429 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "error": "API key credit limit exceeded"
}
```

## 오류

HTTP 409 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "error": "The request uses features that are not supported for the selected model"
}
```

## 오류

HTTP 429 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "error": "Rate limit reached. Please retry later."
}
```

## 오류

HTTP 503 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "error": "Service under maintenance, please try again later"
}
```

## 오류

HTTP 504 - POST /api/v1/fish_audio/text_to_speech

### 응답 스키마

```json
{
  "properties": {
    "error": {
      "description": "사람이 읽을 수 있는 오류 메시지.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### 응답 예시

```json
{
  "error": "The request timed out"
}
```

## 생성된 코드 샘플

cURL을 직접 사용하거나 해당 언어의 SDK를 설치하세요. 각 샘플은 이 레퍼런스에
표시된 유효성 검사된 요청을 제출합니다.

### curl

```curl
curl -X POST https://runapi.ai/api/v1/fish_audio/text_to_speech \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"model":"s1","text":"Welcome to RunAPI."}'
```

### javascript

#### 설치

```bash
npm install @runapi.ai/fish-audio
```

```javascript
import { FishAudioClient } from "@runapi.ai/fish-audio";

const client = new FishAudioClient({ apiKey: process.env.RUNAPI_API_KEY });
const result = await client.textToSpeech.run({
  "model": "s1",
  "text": "Welcome to RunAPI."
});
```

### python

#### 설치

```bash
pip install runapi-fish-audio
```

```python
import os
from runapi.fish_audio import FishAudioClient

client = FishAudioClient(api_key=os.environ["RUNAPI_API_KEY"])
result = client.text_to_speech.run(
  model="s1",
  text="Welcome to RunAPI."
)
```

### go

#### 설치

```bash
go get github.com/runapi-ai/fish-audio-sdk/go@latest
```

```go
package main

import (
  "context"
  "log"
  "os"

  "github.com/runapi-ai/core-sdk/go/option"
  fishaudio "github.com/runapi-ai/fish-audio-sdk/go/fishaudio"
)

func main() {
  client, err := fishaudio.NewClient(option.WithAPIKey(os.Getenv("RUNAPI_API_KEY")))
  if err != nil {
    log.Fatal(err)
  }

  result, err := client.TextToSpeech.Run(context.Background(), fishaudio.TextToSpeechParams{
    Model: "s1",
    Text: "Welcome to RunAPI.",
  })
  if err != nil {
    log.Fatal(err)
  }
  _ = result
}
```

### ruby

#### 설치

```bash
gem install runapi-fish-audio
```

```ruby
require "runapi/fish_audio"

client = RunApi::FishAudio::Client.new(api_key: ENV.fetch("RUNAPI_API_KEY"))
result = client.text_to_speech.run(
  model: "s1",
  text: "Welcome to RunAPI."
)
```

### java

#### 설치

```kotlin
implementation("ai.runapi:runapi-fish-audio")
```

```java
import ai.runapi.fishaudio.FishAudioClient;
import ai.runapi.fishaudio.types.TextToSpeechParams;
import ai.runapi.fishaudio.types.TextToSpeechResponse;

public final class Example {
  public static void main(String[] args) {
    FishAudioClient client = FishAudioClient.builder()
        .apiKey(System.getenv("RUNAPI_API_KEY"))
        .build();
    TextToSpeechResponse result = client.textToSpeech().run(
        TextToSpeechParams.builder()
        .model("s1")
        .text("Welcome to RunAPI.")
            .build()
    );
  }
}
```

### php

#### 설치

```bash
composer require runapi-ai/fish-audio
```

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use RunApi\Core\ClientOptions;
use RunApi\FishAudio\FishAudioClient;

$client = new FishAudioClient(new ClientOptions(apiKey: getenv('RUNAPI_API_KEY')));
$result = $client->textToSpeech->run([
  "model" => "s1",
  "text" => "Welcome to RunAPI."
]);
```

## 관련 가이드

- [인증](https://runapi.ai/ko/docs/guides/authentication.md)
- [빠른 시작](https://runapi.ai/ko/docs/guides/task-api/quickstart.md)

---

## RunAPI의 더 많은 정보

- [홈](https://runapi.ai/ko/.md)
- [모델 카탈로그](https://runapi.ai/ko/models.md)
- [요금](https://runapi.ai/ko/pricing.md)
- [제공사](https://runapi.ai/ko/models)
- [문서](https://runapi.ai/ko/docs/guides)
- [SDK](https://runapi.ai/ko/sdk.md)
- [CLI](https://runapi.ai/ko/cli.md)
- [MCP Server](https://runapi.ai/ko/mcp.md)
- [Claude Code와 Cursor](https://runapi.ai/ko/claude-code-vs-cursor.md)
- [Cursor API 설정](https://runapi.ai/ko/cursor-api-setup.md)
- [RunAPI와 OpenRouter 비교](https://runapi.ai/ko/openrouter-alternative.md)
- [엔터프라이즈](https://runapi.ai/ko/contact.md)
- [문의](https://runapi.ai/ko/contact.md)
- [약관](https://runapi.ai/ko/terms.md)
- [개인정보](https://runapi.ai/ko/privacy.md)
- [에이전트용 사이트 색인](https://runapi.ai/llms.txt)

문의: contact@runapi.ai

## 구조화된 데이터

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ko",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ko",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ko/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ko",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ko",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/koicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ko",
    "@type": "TechArticle",
    "headline": "Fish Audio 텍스트→음성",
    "description": "텍스트를 음성으로 변환하는 엔드포인트를 사용하여 동일한 응답에서 결과를 받으세요.",
    "url": "https://runapi.ai/ko/docs/api/fish-audio/text-to-speech",
    "mainEntityOfPage": "https://runapi.ai/ko/docs/api/fish-audio/text-to-speech"
  }
]
```
