REST API

POST

/api/v1/audio/transcriptions

Speech to text. Upload an audio file as multipart/form-data and get the transcript back as JSON, plain text or subtitles. The request follows OpenAI's audio.transcriptions.create.

URL
https://railwail.com/api/v1/audio/transcriptions
Key scope
audio
Body
multipart, file ≤ 25 MB
Returns
json · text · srt · vtt

Form fields

filerequired
file
The recording: mp3, wav, m4a, webm, ogg, flac or mp4, at most 25 MB.
modelrequired
string
Model slug from the list below.
language
string
ISO-639-1 hint such as en or de. Improves accuracy when known.
prompt
stringmodel-dependent
Context to bias the decoder: names, jargon, the previous sentence.
response_format
string
json, verbose_json, text, srt or vtt. text, srt and vtt come back as plain text.Default json
temperature
numbermodel-dependent
0–1.
timestamp_granularities
string[]model-dependent
word and/or segment, with verbose_json.

Examples

Key in RAILWAIL_API_KEY with the audio scope; audio.mp3 is your file.

// ESM: save as transcribe.mjs
import fs from "node:fs";
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.RAILWAIL_API_KEY,
  baseURL: "https://railwail.com/api/v1",
});

const transcript = await client.audio.transcriptions.create({
  model: "whisper-replicate",
  file: fs.createReadStream("audio.mp3"),
});
console.log(transcript.text);

Response

With json (default); verbose_json adds segments and, where the model returns them, language and duration.

JSON
{
  "text": "<the transcript>"
}

Subtitles: response_format=srt or vtt return the file content as text. The railwail npm SDK has no transcription method; use the OpenAI SDK or plain HTTP.

Models you can call here

Errors

StatusCodeWhat to do
400missing_fileNo file field in the form.
400empty_fileThe uploaded file has no content.
400invalid_bodyThe body is not multipart/form-data.
413file_too_largeOver 25 MB. Split the recording or compress it.
402insufficient_creditsTop up on the billing page.
403insufficient_scopeThe key lacks the audio scope.
429trial_limitTrial rules (at most 2 credits per run until the first top-up).
503model_unavailableNo verified price or the provider is not reachable; pick another model.

All codes: Error codes.