Transcription
Turn speech into text, with the start and end of every word. POST an audio file to /v1/audio/transcriptions with your API key. The request is OpenAI's transcription request, so an OpenAI SDK pointed at FastMetal works as it is.
A request
A multipart form with the file and the model. Ask for verbose_json and word timings to get every word with its start and end in seconds.
curl -sS -X POST https://api.fastmetal.ai/v1/audio/transcriptions \
-H "Authorization: Bearer $FASTMETAL_API_KEY" \
-F "model=whisper-large-v3" \
-F "file=@line.mp3" \
-F "response_format=verbose_json" \
-F "timestamp_granularities[]=word"Fields
fileRequired. One audio file: WAV (PCM or float), FLAC, Ogg Opus or MP3, at most 25 MiB and 30 minutes. M4A, WebM, AAC, Ogg Vorbis and compressed WAV are refused, naming the formats that are accepted.modelRequired. A transcription model from the pricing page, such as whisper-large-v3.response_formatjson or verbose_json. Without it the answer is verbose_json. text, srt and vtt are refused: build captions from verbose_json's words and segments.timestamp_granularities[]word, segment or both, each once. Needs verbose_json (or no response_format). Send it with the brackets, as the OpenAI SDKs do; a single timestamp_granularities=word is read the same way.languageThe language spoken, as an ISO 639-1 code such as en or ja. Optional: without it the model detects the language.promptOptional text in the same language that guides spelling, such as product names. At most 2,048 bytes.temperatureOptional, from 0 to 1.
Any other field is refused with a 400 before anything is charged.
Word timings
With timestamp_granularities[]=word the answer lists every word with its start and end in seconds, in the order spoken, beside the text. With word alone, segments comes back null; send timestamp_granularities[]=segment as well to get both.
In Japanese a word is the piece of text the model returns, often a few characters or part of a word (for example サ, ーバ, ー for サーバー), not a dictionary word. Join the pieces to time captions.
{
"text": " This plan is built for SEO and AEO with servers in over 200 cities.",
"task": "transcribe",
"language": "en",
"duration": 6.16,
"words": [
{ "word": " This", "start": 0.33, "end": 0.59 },
{ "word": " plan", "start": 0.59, "end": 0.81 },
{ "word": " is", "start": 0.81, "end": 1.03 },
...
],
"segments": null
}To time captions, take the words (or the segments) from a verbose_json answer and write the subtitle file from their start and end times. Ogg means Ogg Opus; an Ogg Vorbis file is refused.
Price
Billed by the second of audio; the pricing page shows the price of a minute. The length is measured from the file itself, rounded up to the second (at least one), and the price is reserved against the key's budget before the model is called. It is billed whether or not any words come back. A request refused before the call costs nothing, and so does a call the model fails.
An MP3 is measured by its frames, which include the encoder's own padding, so it can be billed a second more than it plays.
Errors
400A field that is not accepted, a value out of range, a format that is not accepted, a file whose length cannot be measured, or audio over 30 minutes.413The file is larger than 25 MiB.429budget_exceeded: the price of this audio does not fit what is left of the key's budget.503The price could not be confirmed or reserved right now. Nothing was charged; retry.