Example Usage
import { STTResponse } from "@openrouter/sdk/models";
let value: STTResponse = {
text: "Hello, this is a test of OpenAI speech-to-text transcription.",
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
duration | number | :heavy_minus_sign: | Duration of the input audio in seconds, present when response_format is verbose_json | 9.2 |
language | string | :heavy_minus_sign: | Detected or forced language, present when response_format is verbose_json | english |
segments | models.STTSegment[] | :heavy_minus_sign: | Timestamped transcript segments, present when response_format is verbose_json | |
task | string | :heavy_minus_sign: | The task performed, present when response_format is verbose_json | transcribe |
text | string | :heavy_check_mark: | The transcribed text | Hello, this is a test of OpenAI speech-to-text transcription. The weather is sunny today and the temperature is around 72 degrees. |
usage | models.STTUsage | :heavy_minus_sign: | Aggregated usage statistics for the request | { “cost”: 0.000508, “input_tokens”: 83, “output_tokens”: 30, “seconds”: 9.2, “total_tokens”: 113 } |
words | models.STTWord[] | :heavy_minus_sign: | Timestamped words, present when the provider returns word-level timestamps |