Zum Hauptinhalt springen
POST
/
audio
/
transcriptions
/api/v1/audio/transcriptions
curl --request POST \
  --url https://api.venice.ai/api/v1/audio/transcriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form model=openai/whisper-large-v3 \
  --form response_format=json \
  --form timestamps=false
import requests

url = "https://api.venice.ai/api/v1/audio/transcriptions"

files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
    "model": "openai/whisper-large-v3",
    "response_format": "json",
    "timestamps": "false"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.text)
const form = new FormData();
form.append('file', '[audio file]');
form.append('model', 'openai/whisper-large-v3');
form.append('response_format', 'json');
form.append('timestamps', 'false');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

fetch('https://api.venice.ai/api/v1/audio/transcriptions', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.venice.ai/api/v1/audio/transcriptions",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n[audio file]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nopenai/whisper-large-v3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"response_format\"\r\n\r\njson\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001--",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: multipart/form-data"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.venice.ai/api/v1/audio/transcriptions"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n[audio file]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nopenai/whisper-large-v3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"response_format\"\r\n\r\njson\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001--")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.venice.ai/api/v1/audio/transcriptions")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n[audio file]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nopenai/whisper-large-v3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"response_format\"\r\n\r\njson\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001--")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.venice.ai/api/v1/audio/transcriptions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n[audio file]\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model\"\r\n\r\nopenai/whisper-large-v3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"response_format\"\r\n\r\njson\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timestamps\"\r\n\r\nfalse\r\n-----011000010111000001101001--"

response = http.request(request)
puts response.read_body
{
  "text": "<string>",
  "duration": 123,
  "timestamps": {
    "word": [
      {
        "word": "<string>",
        "start": 123,
        "end": 123
      }
    ],
    "segment": [
      {
        "text": "<string>",
        "start": 123,
        "end": 123
      }
    ],
    "char": [
      {
        "char": "<string>",
        "start": 123,
        "end": 123
      }
    ]
  }
}
{
  "error": "<string>",
  "details": {
    "_errors": [],
    "field": {
      "_errors": [
        "Field is required"
      ]
    }
  }
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}
{
  "code": "PAYLOAD_TOO_LARGE",
  "error": "File exceeds the maximum allowed size of 25 MB."
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data

Request to transcribe audio to text.

file
file

The audio file object (not a base64 string). Supported formats: WAV, WAVE, FLAC, M4A, AAC, MP4, MP3, OGG, OGA, WEBM.

model
enum<string>
Standard:nvidia/parakeet-tdt-0.6b-v3

The model to use for transcription. See https://docs.venice.ai/models/overview for more information.

Verfügbare Optionen:
nvidia/parakeet-tdt-0.6b-v3,
openai/whisper-large-v3,
fal-ai/wizper,
elevenlabs/scribe-v2,
stt-xai-v1
Beispiel:

"openai/whisper-large-v3"

response_format
enum<string>
Standard:json

The format of the transcript output, in one of these options: json, text.

Verfügbare Optionen:
json,
text
Beispiel:

"json"

timestamps
boolean
Standard:false

Whether to include timestamps in the response.

Beispiel:

false

language
string

ISO 639-1 language code (e.g., "en", "es", "fr"). Optional - if not provided, the model will auto-detect the language. Note: Only supported by certain models (e.g., Whisper). Ignored by models that do not support language hints.

Beispiel:

"en"

Antwort

Transcription completed successfully

Transcription response

text
string
erforderlich

The transcribed text

duration
number

Duration of the audio in seconds

timestamps
object

Timestamps for the transcription (only if timestamps=true)