Query model Speech-to-Text
Query out Speech-to-text model. The input format is the same has OpenAI API. In async mode, use the following endpoint to get the result
Path parameters
AI API product identifier
Body Parameters
application/jsonOnly if timestamp_granularities[]:word is True, merge these punctuation symbols with the previous word
Defines the maximum duration for an active segment in sec. For subtitle tasks, it's recommended to set this to a short duration (5-10 seconds) to avoid long sentences.
The audio file to transcribe (50mo max, types : mp3,mp4,aac,wav,flac,ogg,opus,wma,m4a)
Subtitle task. Underline each word as it is spoken in srt and vtt output formats (requires timestamp_granularities[]:word)
The language of the input audio. Supplying the input language will translate the output.
Subtitle task. The maximum number of lines in a segment in srt and vtt output formats (requires timestamp_granularities[]:word)
Subtitle task. The maximum number of characters in a line before breaking the line in srt and vtt output formats (requires timestamp_granularities[]:word)
Subtitle task. The maximum number of words in a segment (requires timestamp_granularities[]:word)
ID of the model to use.
If the no_speech probability is higher than this value AND the average log probability over sampled tokens is below log_prob_threshold
, consider the segment as silent.
Only if timestamp_granularities[]:word is True, merge these punctuation symbols with the next word
An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.
The format of the transcript output (default: json)
The timestamp granularities to populate for this transcription. Either or both of these options are supported: word, or segment. Requires response_format=verbose_json
. Defaults to segment.
Response Body
The id of the batch dispatched handling the transcription.
Example request
<?php
use GuzzleHttp\Client;
$client = new Client();
$headers = [
'Authorization' => 'Bearer YOUR-TOKEN-HERE',
'Content-Type' => 'application/json'
];
$body = '{
"file": "example",
"model": "whisper"
}';
$request = new Request('POST', 'https://api.infomaniak.com/1/ai/{product_id}/openai/audio/transcriptions', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Example response
application/json
{"batch_id":"9b9fec49-cc95-44d5-8d3a-be56a6e05970"}