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

# TTS（文字转语音）

> 使用 Go 封装调用 `/audio/speech`。

使用封装方法：

* `client.CreateSpeech(ctx, req)`

```go theme={null}
import (
  "context"
  "fmt"
  phaseo "github.com/phaseoteam/Phaseo/packages/sdk/sdk-go/v3"
)

client := phaseo.New(apiKey, "https://api.phaseo.app/v1")
resp, err := client.CreateSpeech(context.Background(), map[string]interface{}{
  "model": "openai/gpt-4o-mini-tts",
  "input": "Hello from Phaseo",
  "voice": "alloy",
  "format": "mp3",
})
if err != nil {
  panic(err)
}
fmt.Println(resp)
```


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