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

# STT（语音转文本）

> 使用 PHP SDK 调用 /audio/transcriptions。

**方法**：`$client->generateTranscription(...)` 或 `$client->createTranscription(...)`

### 示例

```php theme={null}
<?php

require 'vendor/autoload.php';

use Phaseo\Sdk\Phaseo;

$client = new Phaseo(getenv('PHASEO_API_KEY'));
$response = $client->generateTranscription([
    'model' => 'openai/gpt-4o-transcribe',
    'audio_url' => 'https://example.com/audio.mp3', // or 'audio_b64' for base64 data
    'language' => 'en'
]);
echo $response['text'] ?? '';
```

### 关键参数

* `model`（必填）：支持转录的模型 ID。
* `audio_url` 或 `audio_b64`（必填）：通过 URL 或 Base64 提供的音频数据。
* `language`：语言提示代码，例如 `en`。
* `prompt`：用于提高准确性的可选上下文。
* `temperature`（0–2）：采样随机度。
* `response_format`：`json`、`text`、`srt`、`verbose_json` 等。

### 返回值

AudioTranscriptionResponse


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.