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
filerequiredfile
The recording: mp3, wav, m4a, webm, ogg, flac or mp4, at most 25 MB.
modelrequiredstring
Model slug from the list below.
languagestring
ISO-639-1 hint such as en or de. Improves accuracy when known.
promptstringmodel-dependent
Context to bias the decoder: names, jargon, the previous sentence.
response_formatstring
json, verbose_json, text, srt or vtt. text, srt and vtt come back as plain text.Default
jsontemperaturenumbermodel-dependent
0–1.
timestamp_granularitiesstring[]model-dependent
word and/or segment, with verbose_json.
Examples
Key in RAILWAIL_API_KEY with the audio scope; audio.mp3 is your file.
curl https://railwail.com/api/v1/audio/transcriptions \
-H "Authorization: Bearer $RAILWAIL_API_KEY" \
-F [email protected] \
-F model=whisper-replicate \
-F response_format=jsonimport os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["RAILWAIL_API_KEY"],
base_url="https://railwail.com/api/v1",
)
with open("audio.mp3", "rb") as audio:
transcript = client.audio.transcriptions.create(model="whisper-replicate", file=audio)
print(transcript.text)// 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.
{
"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
- Incredibly Fast Whisper
incredibly-fast-whisper≈ US$ 0,0056/uitvoering - Whisper
whisper-replicate≈ US$ 0,0034/uitvoering
2 models run on this endpoint right now · prices as charged, in USDSee all with filters
Errors
| Status | Code | What to do |
|---|---|---|
| 400 | missing_file | No file field in the form. |
| 400 | empty_file | The uploaded file has no content. |
| 400 | invalid_body | The body is not multipart/form-data. |
| 413 | file_too_large | Over 25 MB. Split the recording or compress it. |
| 402 | insufficient_credits | Top up on the billing page. |
| 403 | insufficient_scope | The key lacks the audio scope. |
| 429 | trial_limit | Trial rules (at most 2 credits per run until the first top-up). |
| 503 | model_unavailable | No verified price or the provider is not reachable; pick another model. |
All codes: Error codes.