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

# STT (Speech to Text)

> Call /audio/transcriptions with the Ruby SDK.

**Method**: `client.generate_transcription(...)` or `client.create_transcription(...)`.

### Example

```ruby theme={null}
require 'ai_stats_sdk'

client = AIStatsSdk::AIStats.new(api_key: ENV.fetch("AI_STATS_API_KEY"))
transcript = client.generate_transcription(
  model: 'openai/gpt-4o-transcribe',
  audio_b64: 'base64_audio_data',
  language: 'en'
)
```

### Key parameters

* `model` (required): Transcription-capable model id.
* `audio_url` or `audio_b64` (required): Audio data (URL or base64).
* `language`: Hint language code (e.g., `en`).
* `prompt`: Optional context to improve accuracy.
* `temperature` (0–2): Sampling randomness.
* `response_format`: `json`, `text`, `srt`, `verbose_json`, etc.

### Returns

`AudioTranscriptionResponse`
