Speech to Text
Request fields, formats, timestamps, and limits for Speech to Text.
Create a transcription with POST /v1/audio/transcriptions. The endpoint accepts multipart/form-data and follows the OpenAI Whisper API request style.
Create a transcription
TaskInfer operates Speech to Text with Whisper Large V3. Model operation is managed internally and is not a request parameter.
Request fields
| Field | Required | Description |
|---|---|---|
file | Yes | Uploaded audio/video file or public HTTPS URL, up to 100 MB. |
language | No | Hint for the spoken language. |
prompt | No | Text that guides spelling or transcription style. |
response_format | No | json, text, or verbose_json; defaults to json. |
temperature | No | Sampling temperature from 0 through 1. |
timestamp_granularities[] | No | One or both of segment and word. Requires verbose_json. |
speaker_labels | No | Enables speaker diarization. Requires verbose_json. |
Response formats
JSON responses
JSON responses always include a lowercase ISO 639-1 language code:
{
"language": "en",
"text": "Hello from TaskInfer."
}When segments are requested, every segment also includes language. TaskInfer
uses a provider-supplied language when available. Missing languages are detected
from the transcript with a minimum confidence of 0.1; an undetected segment
falls back to the top-level language, and an undetected top-level language falls
back to en.
Text responses
Set response_format=text when you only need the transcript body:
import { readFile } from "node:fs/promises";
const form = new FormData();
form.append(
"file",
new Blob([await readFile("interview.mp3")], { type: "audio/mpeg" }),
"interview.mp3",
);
form.append("response_format", "text");
const response = await fetch("https://taskinfer.com/v1/audio/transcriptions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TASKINFER_API_KEY}`,
},
body: form,
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.text());Timestamped responses
Timestamp granularities are available only with verbose JSON:
import { readFile } from "node:fs/promises";
const form = new FormData();
form.append(
"file",
new Blob([await readFile("interview.mp3")], { type: "audio/mpeg" }),
"interview.mp3",
);
form.append("response_format", "verbose_json");
form.append("timestamp_granularities[]", "segment");
form.append("timestamp_granularities[]", "word");
const response = await fetch("https://taskinfer.com/v1/audio/transcriptions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TASKINFER_API_KEY}`,
},
body: form,
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());Remote files
TaskInfer also accepts a public HTTPS address in the same file field. Uploaded and remote files share the 100 MB limit and the same response behavior. TaskInfer downloads and validates the remote file before transcription; private-network addresses are blocked. The upstream OpenAI transcription API accepts file uploads only, so this URL form is a TaskInfer extension.
const form = new FormData();
form.append("file", "https://cdn.example.com/interview.mp3");
const response = await fetch("https://taskinfer.com/v1/audio/transcriptions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TASKINFER_API_KEY}`,
},
body: form,
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());Limits and billing
Speech to Text accepts uploaded files or public HTTPS URLs up to 100 MB. Usage is billed at 50 credits per started audio second.
Errors
TaskInfer returns 400 Bad Request if timestamps or speaker labels are requested with another response format.
Related guides
Prepare authentication in Get started. For common HTTP failures, see Errors and troubleshooting. For endpoint and request definitions, see the API Reference.