> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# STTRequest

Speech-to-text request input. Accepts a JSON body with input\_audio containing base64-encoded audio or a URL the provider downloads.

## Example Usage

```typescript theme={null}
import { STTRequest } from "@openrouter/sdk/models";

let value: STTRequest = {
  inputAudio: {
    data: "UklGRiQA...",
    format: "wav",
  },
  model: "openai/whisper-large-v3",
};
```

## Fields

| Field | Type | Required | Description | Example |
| - | - | - | - | - |
| `diarize` | *boolean* | :heavy\_minus\_sign: | Label each word with the speaker who said it. Speaker labels are returned on the words array (speaker, speaker\_label), so response\_format must be "verbose\_json" (a "json" request is rejected with a 400) and word timestamps are included even when timestamp\_granularities omits "word". Only supported by some providers; the request is rejected with a 400 when the selected model cannot diarize. Providers may charge extra. | true |
| `inputAudio` | *models.STTInputAudio* | :heavy\_check\_mark: | Audio to transcribe: inline base64 bytes, or a URL the provider downloads directly. | |
| `keyterms` | *string*\[] | :heavy\_minus\_sign: | Domain terms, names, or phrases to bias recognition toward. Only supported by some providers; the request is rejected with a 400 when the selected model cannot use keyterms. Providers may cap the number of terms or characters per term and may charge extra. | \[<br />"OpenRouter",<br />"Scribe"<br />] |
| `language` | *string* | :heavy\_minus\_sign: | ISO-639-1 language code (e.g., "en", "ja"). Auto-detected if omitted. | en |
| `model` | *string* | :heavy\_check\_mark: | STT model identifier | openai/whisper-large-v3 |
| `provider` | [models.STTRequestProvider](../models/sttrequestprovider.mdx) | :heavy\_minus\_sign: | Provider-specific passthrough configuration | |
| `responseFormat` | [models.STTRequestResponseFormat](../models/sttrequestresponseformat.mdx) | :heavy\_minus\_sign: | Output format. "json" (default) returns \{ text, usage }. "verbose\_json" additionally returns task, language, duration, and segment-level timestamps; only supported by OpenAI-compatible providers. | json |
| `sessionId` | *string* | :heavy\_minus\_sign: | A unique identifier for grouping related requests (e.g., a conversation or agent workflow). Used for observability grouping in Broadcast and private logging; never sent to the provider. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. | session-1234 |
| `temperature` | *number* | :heavy\_minus\_sign: | Sampling temperature for transcription | 0 |
| `timestampGranularities` | [models.STTTimestampGranularity](../models/stttimestampgranularity.mdx)\[] | :heavy\_minus\_sign: | Timestamp detail levels to include when response\_format is "verbose\_json". "segment" returns segment-level timestamps; "word" additionally returns word-level timestamps in the words array. Ignored unless response\_format is "verbose\_json". | \[<br />"segment"<br />] |
| `trace` | [models.TraceConfig](../models/traceconfig.mdx) | :heavy\_minus\_sign: | Metadata for observability and tracing. Known keys (trace\_id, trace\_name, span\_name, generation\_name, parent\_span\_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. | \{<br />"trace\_id": "trace-abc123",<br />"trace\_name": "my-app-trace"<br />} |
| `user` | *string* | :heavy\_minus\_sign: | A unique identifier representing your end-user. Forwarded to Broadcast and private logging as the end-user id; never sent to the provider. | user-1234 |
