# 文字转语音接口

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v2.Gptliu/speech:
    post:
      summary: 文字转语音接口
      deprecated: false
      description: |
        token获取方式：
        访问公众号《冰橙云》进入菜单冰橙AI助手后，访问右上角 / 个人（首次访问免费赠送15000字符，可通过充值增加字符数）可查看 token
        访问：https://yewu.bcwhkj.cn 》 个人 》Token令牌 获取（首次访问赠送15000字符）

        价格说明：
        ◆ 音频生成最低消耗10000字符，具体根据提交的文字长度和返回的音频数据文件内容长度而定，因OPENAI接口特殊性，如无返回内容将不退还字符

        ◆ 注：
        model接口目前暂不支持tts-1HD ，如有需要可联系我司公众号页留言或进入冰橙AI助手后右上角导航栏内的“意见建议”进行咨询
      tags:
        - 文生音 音频生成
      parameters:
        - name: Content-Type
          in: header
          description: 固定值
          required: false
          example: application/json
          schema:
            type: string
        - name: Authorization
          in: header
          description: token要更换为个人自己的TOKEN
          example: Bearer token
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: 模型，目前只支持tts-1
                input:
                  type: string
                  description: 要转为音频的文字
                voice:
                  type: string
                  enum:
                    - Alloy
                    - Echo
                    - Fable
                    - onyx
                    - Nova
                    - Shimmer
                  x-apifox:
                    enumDescriptions:
                      Alloy: ''
                      Echo: ''
                      Fable: ''
                      onyx: ''
                      Nova: ''
                      Shimmer: ''
                  description: 音色选择
              required:
                - model
                - input
                - voice
              x-apifox-orders:
                - model
                - input
                - voice
            example:
              model: tts-1
              input: 你说说看你有哪些不懂的地方
              voice: alloy
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  codes:
                    type: integer
                  mess:
                    type: string
                  data:
                    type: object
                    properties:
                      src:
                        type: string
                    required:
                      - src
                    x-apifox-orders:
                      - src
                required:
                  - codes
                  - mess
                  - data
                x-apifox-orders:
                  - codes
                  - mess
                  - data
              example:
                codes: 200
                mess: 音频数据拉取成功
                data:
                  src: https://yewu.bcwhkj.cn/public/down/6648240d67d97.mp3
          headers: {}
          x-apifox-name: 成功
      security: []
      x-apifox-folder: 文生音 音频生成
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/3216478/apis/api-175514990-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://yewu.bcwhkj.cn
    description: 正式环境
security: []

```
