> ## 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.

# SpeechInputModality

An input the model accepts. `audio` and `image` are `input_references` for voice cloning and voice design.

## Supported Types

### SpeechInputModalityText

```go theme={null}
speechInputModality := components.CreateSpeechInputModalityText(components.SpeechInputModalityText{/* values here */})
```

### SpeechInputModalityAudio

```go theme={null}
speechInputModality := components.CreateSpeechInputModalityAudio(components.SpeechInputModalityAudio{/* values here */})
```

### SpeechInputModalityImage

```go theme={null}
speechInputModality := components.CreateSpeechInputModalityImage(components.SpeechInputModalityImage{/* values here */})
```

## Union Discrimination

Use the `Type` field to determine which variant is active, then access the corresponding field:

```go theme={null}
switch speechInputModality.Type {
	case components.SpeechInputModalityTypeTextValue:
		// speechInputModality.SpeechInputModalityText is populated
	case components.SpeechInputModalityTypeAudio:
		// speechInputModality.SpeechInputModalityAudio is populated
	case components.SpeechInputModalityTypeImageValue:
		// speechInputModality.SpeechInputModalityImage is populated
	default:
		// Unknown type - use speechInputModality.GetUnknownRaw() for raw JSON
}
```
