跳转到内容
EN

转写音频

POST/model/v1/audio/transcriptions● 支持

官方文档 ↗

请求体

  • modelstring必填

    Model catalog identifier declaring openai.audio.transcriptions; use it unchanged, including any creator prefix.

    已验证生效。

  • temperaturenumber可选○ 未支持

    whisper-large-v3-turbo、qwen3-asr-flash 均返回 400。

  • response_formatstring可选◐ 部分支持
    默认 "json"

    Output format: json returns text in JSON; text returns plain text; verbose_json includes requested timestamps; diarized_json includes speaker-labelled segments when supported. Defaults to json.

    json/text 返回转写文字;Fun-ASR 支持 diarized_json 的说话人片段,Workers AI whisper 支持 verbose_json 的时间戳。格式能力依模型而定;不支持的组合、srt/vtt 返回 400。

    取值 jsontextverbose_jsondiarized_json
  • promptstring可选◐ 部分支持

    Optional vocabulary or contextual guidance for recognizing the audio; support depends on the selected model.

    仅 whisper-large-v3-turbo 的词表提示已验证生效;qwen3-asr-flash 返回 400。

  • filestring必填

    Audio bytes uploaded as a multipart file; supported formats and input limits depend on the selected model.

    已验证生效。

  • languagestring可选◐ 部分支持

    Source language code when known; omit to let the model detect the language.

    两模型接受 ISO 语言码;qwen3-asr-flash 可能按指定语言翻译输出,whisper-large-v3-turbo 用作输入语言提示。非 ISO 名称可能报 502。

  • timestamp_granularities[]array可选◐ 部分支持

    Timestamp levels to request as repeated multipart fields: word returns per-word times; segment returns segment times. Omit for the model default. Use verbose_json, or diarized_json on supporting models.

    word 返回词级时间戳,segment 返回片段时间戳,可同时请求。Fun-ASR 与 Workers AI whisper 均支持 word;请求 word 时若上游未返回词级数据,返回 400,不伪造词级时间戳。qwen3-asr-flash 不支持时间戳。

返回

200

标准请求字段;不能表达的参数返回 input_not_representable。

鉴权、限流、参数校验等平台错误按 problem+json 返回;OCR 的错误也为 problem+json,其它模型调用的错误按该端点所属格式(OpenAI 或 Anthropic)返回,参见 错误码

请求示例

curl
curl https://api.deepraxis.com/model/v1/audio/transcriptions \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -F "file=@sample.mp3" \
  -F "model=whisper-large-v3-turbo"
Python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepraxis.com/model/v1",
    api_key="$PRAXIS_API_KEY",
)

transcription = client.audio.transcriptions.create(
    file=open("sample.mp3", "rb"),
    model="whisper-large-v3-turbo",
)
TypeScript
import OpenAI from "openai";
import fs from "node:fs";

const client = new OpenAI({
  baseURL: "https://api.deepraxis.com/model/v1",
  apiKey: "$PRAXIS_API_KEY",
});

const transcription = await client.audio.transcriptions.create({
  file: fs.createReadStream("sample.mp3"),
  model: "whisper-large-v3-turbo",
});

响应示例 200

{
  "text": "Hello, welcome to Praxis."
}

响应

HTTP 200

Transcription in the requested format.

text/plain

名称 类型 说明
$ string

application/json

名称 类型 说明
text string Recognized speech text in the original language.
task string transcribe identifies speech-to-text transcription.
language string Detected or requested source language code.
duration number Audio duration in seconds when provided by the model.
segments array<object> Time-aligned speech segments when returned by the selected model and response format.
segments[].id integer Segment identifier within this transcription response.
segments[].start number Inclusive start time in seconds from the beginning of the audio.
segments[].end number Exclusive end time in seconds from the beginning of the audio.
segments[].text string Recognized speech text in the original language.
segments[].speaker string Speaker label in diarized_json when supported; labels distinguish voices and are not verified identities.
segments[].temperature number Decoding temperature reported by the transcription model.
segments[].avg_logprob number Average segment token log probability when provided.
segments[].compression_ratio number Text compression ratio reported for this segment.
segments[].no_speech_prob number Probability of no speech reported for this segment.
words array<object> Per-word source-audio timestamps when word granularity is requested and supported.
words[].word string Recognized word text in its original language.
words[].start number Inclusive word start in seconds from the beginning of the audio.
words[].end number Exclusive word end in seconds from the beginning of the audio.