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

# Translations

> Call /audio/translations with the PHP SDK.

**Method**: `$client->generateTranslation(...)` or `$client->createTranslation(...)`

### Example

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

require 'vendor/autoload.php';

use AIStats\Sdk\AIStats;

$client = new AIStats(getenv('AI_STATS_API_KEY'));
$response = $client->generateTranslation([
    'model' => 'openai/gpt-4o-translate',
    'audio_url' => 'https://example.com/audio.mp3' // or 'audio_b64' for base64 data
]);
echo $response['text'] ?? '';
```

### Key parameters

* `model` (required): Translation-capable model id.
* `audio_url` or `audio_b64` (required): Audio data to translate.
* `prompt`: Optional context to guide translation.
* `temperature` (0–2): Sampling randomness.
* `response_format`: `json`, `text`, `srt`, `verbose_json`, etc.

### Returns

AudioTranscriptionResponse
