Skip to main content
POST
/
audio
/
transcriptions
Create transcription
curl --request POST \
  --url https://openrouter.ai/api/v1/audio/transcriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input_audio": {
    "data": "UklGRiQA...",
    "format": "wav"
  },
  "language": "en",
  "model": "openai/whisper-large-v3"
}
'
import requests

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

payload = {
    "input_audio": {
        "data": "UklGRiQA...",
        "format": "wav"
    },
    "language": "en",
    "model": "openai/whisper-large-v3"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    input_audio: {data: 'UklGRiQA...', format: 'wav'},
    language: 'en',
    model: 'openai/whisper-large-v3'
  })
};

fetch('https://openrouter.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://openrouter.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 => json_encode([
    'input_audio' => [
        'data' => 'UklGRiQA...',
        'format' => 'wav'
    ],
    'language' => 'en',
    'model' => 'openai/whisper-large-v3'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$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://openrouter.ai/api/v1/audio/transcriptions"

	payload := strings.NewReader("{\n  \"input_audio\": {\n    \"data\": \"UklGRiQA...\",\n    \"format\": \"wav\"\n  },\n  \"language\": \"en\",\n  \"model\": \"openai/whisper-large-v3\"\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://openrouter.ai/api/v1/audio/transcriptions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"input_audio\": {\n    \"data\": \"UklGRiQA...\",\n    \"format\": \"wav\"\n  },\n  \"language\": \"en\",\n  \"model\": \"openai/whisper-large-v3\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://openrouter.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["Content-Type"] = 'application/json'
request.body = "{\n  \"input_audio\": {\n    \"data\": \"UklGRiQA...\",\n    \"format\": \"wav\"\n  },\n  \"language\": \"en\",\n  \"model\": \"openai/whisper-large-v3\"\n}"

response = http.request(request)
puts response.read_body
{
  "text": "Hello, this is a test of OpenAI speech-to-text transcription.",
  "usage": {
    "cost": 0.000508,
    "input_tokens": 83,
    "output_tokens": 30,
    "seconds": 9.2,
    "total_tokens": 113
  }
}
{
  "error": {
    "code": 400,
    "message": "Invalid request parameters"
  }
}
{
  "error": {
    "code": 401,
    "message": "Missing Authentication header"
  }
}
{
  "error": {
    "code": 402,
    "message": "Insufficient credits. Add more using https://openrouter.ai/credits"
  }
}
{
  "error": {
    "code": 404,
    "message": "Resource not found"
  }
}
{
  "error": {
    "code": 429,
    "message": "Rate limit exceeded"
  }
}
{
  "error": {
    "code": 500,
    "message": "Internal Server Error"
  }
}
{
  "error": {
    "code": 502,
    "message": "Provider returned error"
  }
}
{
  "error": {
    "code": 503,
    "message": "Service temporarily unavailable"
  }
}
{
  "error": {
    "code": 524,
    "message": "Request timed out. Please try again later."
  }
}
{
  "error": {
    "code": 529,
    "message": "Provider returned error"
  }
}

Authorizations

Authorization
string
header
required

API key as bearer token in Authorization header

Body

Speech-to-text request input. Accepts a JSON body with input_audio containing base64-encoded audio.

input_audio
object
required

Base64-encoded audio to transcribe

Example:
{ "data": "UklGRiQA...", "format": "wav" }
model
string
required

STT model identifier

Example:

"openai/whisper-large-v3"

language
string

ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted.

Example:

"en"

provider
object

Provider-specific passthrough configuration

response_format
enum<string>

Output format. "json" (default) returns { text, usage }. "verbose_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers.

Available options:
json,
verbose_json
Example:

"json"

temperature
number<double>

Sampling temperature for transcription

Example:

0

timestamp_granularities
enum<string>[]

Timestamp detail levels to include when response_format is "verbose_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response_format is "verbose_json".

A timestamp detail level for verbose_json transcription responses.

Available options:
word,
segment
Example:
["segment"]

Response

Transcription result

STT response containing transcribed text and optional usage statistics

text
string
required

The transcribed text

Example:

"Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees."

duration
number<double>

Duration of the input audio in seconds, present when response_format is verbose_json

Example:

9.2

language
string

Detected or forced language, present when response_format is verbose_json

Example:

"english"

segments
object[]

Timestamped transcript segments, present when response_format is verbose_json

task
string

The task performed, present when response_format is verbose_json

Example:

"transcribe"

usage
object

Aggregated usage statistics for the request

Example:
{
  "cost": 0.000508,
  "input_tokens": 83,
  "output_tokens": 30,
  "seconds": 9.2,
  "total_tokens": 113
}
words
object[]

Timestamped words, present when the provider returns word-level timestamps