> ## Documentation Index
> Fetch the complete documentation index at: https://docs.socialvision.tisyk.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 语音合成与转录 (TTS / STT)

> OpenAI 格式语音生成 (Speech) 与音频转文字 (Transcriptions)

## 创建语音 gpt-4o-mini-tts

`POST /v1/audio/speech`

官方文档：[https://platform.openai.com/docs/guides/text-to-speech](https://platform.openai.com/docs/guides/text-to-speech)

### 请求体参数 (Body)

<ParamField body="input" type="string" required>
  要生成音频的文本。最大长度为4096个字符。
</ParamField>

<ParamField body="model" type="string" required>
  可用的 TTS 模型之一:tts-1 或 tts-1-hd
</ParamField>

<ParamField body="response_format" type="string">
  默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。
</ParamField>

<ParamField body="speed" type="number">
  默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。
</ParamField>

<ParamField body="voice" type="string" required>
  生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。
</ParamField>

### 请求示例 (JSON)

```json theme={null}
{
  "input": "The quick brown fox jumped over the lazy dog.",
  "model": "gpt-4o-mini-tts",
  "voice": "alloy"
}
```

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/v1/audio/speech" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "The quick brown fox jumped over the lazy dog.",
  "model": "gpt-4o-mini-tts",
  "voice": "alloy"
}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "id": "resp_example",
  "object": "response",
  "status": "completed"
}
```

***

## 音频转文字 gpt-4o-transcribe

`POST /v1/audio/transcriptions`

官方文档：[https://platform.openai.com/docs/guides/speech-to-text](https://platform.openai.com/docs/guides/speech-to-text)

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/v1/audio/transcriptions" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "text": "一二三四五六七八九十"
}
```

***

## 创建翻译（部分模型不支持）

`POST /v1/audio/translations`

将音频翻译为英文文本。官方文档：[https://platform.openai.com/docs/api-reference/audio/createTranslation](https://platform.openai.com/docs/api-reference/audio/createTranslation)

### 请求示例 (cURL)

```bash theme={null}
curl -X POST "https://socialvision.tisyk.xyz/v1/audio/translations" \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### 响应示例 (200 OK)

```json theme={null}
{
  "text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?"
}
```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.