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

# TTS (Text to Speech)

> Call /audio/speech with the Java SDK.

**Method**: `client.createSpeech(...)`

```java theme={null}
import ai.stats.sdk.AIStats;

AIStats client = new AIStats(System.getenv("AI_STATS_API_KEY"));

String body = """
{
  "model": "openai/gpt-4o-mini-tts",
  "input": "Hello from Java",
  "voice": "alloy",
  "format": "mp3"
}
""";

Object response = client.createSpeech(body);
System.out.println(String.valueOf(response));
```
