Models
Browse all ASR models.Example
Supported audio formats
mp3wav
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Transcribe audio to text using Whisper and other speech recognition models.
curl -X POST \
-H "Authorization: Bearer $DEEPINFRA_API_KEY" \
-F audio=@audio.mp3 \
'https://api.deepinfra.com/v1/inference/openai/whisper-large-v3'
import { AutomaticSpeechRecognition } from "deepinfra";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const DEEPINFRA_API_KEY = process.env.DEEPINFRA_API_KEY;
const MODEL = "openai/whisper-large-v3";
const client = new AutomaticSpeechRecognition(MODEL, DEEPINFRA_API_KEY);
const input = {
audio: path.join(__dirname, "audio.mp3"),
};
const response = await client.generate(input);
console.log(response.text);
mp3wav{
"text": "Hello, this is a transcription of the audio file.",
"segments": [
{
"start": 0.0,
"end": 3.5,
"text": "Hello, this is a transcription of the audio file."
}
]
}