跳转到主要内容 跳转到页脚
Bricks Templates
  • 首页
  • 模型列表
  • 文档
进入API中转站

入门

1
  • 快速接入

默拉APi

9
  • 聊天对话
  • 音频(Audio)
  • 自动补全
  • 嵌入向量
  • 微调模型
  • 创建图像
  • 模型列表
  • 上传文件
  • 内容审查
  • 首页
  • 文档
  • 默拉API中转站
  • 默拉APi
  • 音频(Audio)

音频(Audio)

POST 创建语音 #

POST https://api.mygptlife.com/v1/audio/speech

Body 请求参数

{
  "model": "tts-1",
  "input": "The quick brown fox jumped over the lazy dog.",
  "voice": "alloy"
}

请求参数 #

名称位置类型必选说明
Authorizationheaderstring否none
bodybodyobject否none
» modelbodystring是可用的 TTS 模型之一:tts-1 或 tts-1-hd
» inputbodystring是要生成音频的文本。最大长度为4096个字符。
» voicebodystring是生成音频时使用的语音。支持的语音有:alloy、echo、fable、onyx、nova 和 shimmer。
» response_formatbodystring否默认为 mp3 音频的格式。支持的格式有:mp3、opus、aac 和 flac。
» speedbodynumber否默认为 1 生成的音频速度。选择0.25到4.0之间的值。1.0是默认值。

返回示例

200 Response

{}

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

POST 创建转录 #

POST https://api.mygptlife.com/v1/audio/transcriptions

Body 请求参数

file: string
model: string
language: string
prompt: string
response_format: string
temperature: 0

请求参数 #

名称位置类型必选说明
Authorizationheaderstring否none
bodybodyobject否none
» filebodystring(binary)是要转录的音频文件对象(不是文件名),格式为:flac、mp3、mp4、mpeg、mpga、m4a、ogg、wav 或 webm。
» modelbodystring是要使用的模型 ID。目前只有 whisper-1 是可用的。
» languagebodystring否输入音频的语言。以 ISO-639-1 格式提供输入语言可以提高准确性和延迟。
» promptbodystring否一个可选的文本来指导模型的风格或继续之前的音频段落。提示应该与音频语言匹配。
» response_formatbodystring否默认为 json
» temperaturebodynumber否默认为 0

详细说明 #

» response_format: 默认为 json 转录输出的格式,可选择:json、text、srt、verbose_json 或 vtt。

» temperature: 默认为 0 采样温度,between 0 和 1。更高的值像 0.8 会使输出更随机,而更低的值像 0.2 会使其更集中和确定性。如果设置为 0,模型将使用对数概率自动增加温度直到达到特定阈值。

返回示例

成功

{
  "text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that."
}

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

状态码 200

名称类型必选约束中文名说明
» textstringtruenonenone

GET 创建翻译 #

GET https://api.mygptlife.com/v1/audio/translations

Body 请求参数

file: string
model: string
prompt: string
response_format: string
temperature: 0

请求参数 #

名称位置类型必选说明
Authorizationheaderstring否none
bodybodyobject否none
» filebodystring(binary)是要翻译的音频文件对象(不是文件名),格式为:flac、mp3、mp4、mpeg、mpga、m4a、ogg、wav 或 webm。
» modelbodystring是要使用的模型 ID。目前只有 whisper-1 是可用的。
» promptbodystring否一个可选的文本,用于指导模型的风格或继续之前的音频段落。提示文本应该是英文。
» response_formatbodystring否翻译结果的格式,可选择:json、text、srt、verbose_json 或 vtt。
» temperaturebodynumber否默认为 0

详细说明 #

» temperature: 默认为 0 采样温度,介于 0 和 1 之间。更高的值如 0.8 会使输出更随机,而较低的值如 0.2 会使其更聚焦和确定性。如果设置为 0,模型将使用对数概率自动提高温度直到达到特定阈值。

返回示例

成功

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

返回结果 #

状态码状态码含义说明数据模型
200OK(opens new window)成功Inline

返回数据结构 #

状态码 200

名称类型必选约束中文名说明
» textstringtruenonenone
您的感觉是什么
还有问题?我们能帮忙吗?

需要什么帮助?

更新 2024-06-04
聊天对话自动补全
内容目录
  • POST 创建语音
    • 请求参数
    • 返回结果
    • 返回数据结构
  • POST 创建转录
    • 请求参数
      • 详细说明
    • 返回结果
    • 返回数据结构
  • GET 创建翻译
    • 请求参数
      • 详细说明
    • 返回结果
    • 返回数据结构
© 2020-2024 默拉智能API中转站