---
title: Audio transcription and speech
description: Transcribe audio files and synthesize speech through supported OpenAI-compatible routes.
---

<ApiEndpoint method="POST" path="/v1/audio/speech" auth="api_key" />

Zorveus routes text-to-speech (`/v1/audio/speech`) and audio transcription (`/v1/audio/transcriptions`) requests using OpenAI-compatible audio models.

<KeyInserter type="api" label="API Key Tester" placeholder="zrv_your_api_key" />

---

## Generate speech

<CodeGroup titles={["Python (OpenAI SDK)", "TypeScript (OpenAI SDK)"]}>

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.zorveus.com/v1",
    api_key="zrv_your_api_key",
)

response = client.audio.speech.create(
    model="openai/tts-1",
    voice="alloy",
    input="Welcome to Zorveus. Your unified AI billing and gateway platform.",
)

response.stream_to_file("output.mp3")
```

```typescript
import OpenAI from "openai";
import fs from "fs";

const client = new OpenAI({
  baseURL: "https://api.zorveus.com/v1",
  apiKey: "zrv_your_api_key",
});

async function main() {
  const mp3 = await client.audio.speech.create({
    model: "openai/tts-1",
    voice: "alloy",
    input: "Welcome to Zorveus. Your unified AI billing and gateway platform.",
  });

  const buffer = Buffer.from(await mp3.arrayBuffer());
  await fs.promises.writeFile("output.mp3", buffer);
}

main();
```

</CodeGroup>

The response is binary audio. Write it to a file or stream it with the content type returned by the gateway. The selected model determines the available voices and response formats.

## Transcribe audio

<ApiEndpoint method="POST" path="/v1/audio/transcriptions" auth="api_key" />

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.zorveus.com/v1",
    api_key="zrv_your_api_key",
)

with open("meeting.wav", "rb") as audio_file:
    transcript = client.audio.transcriptions.create(
        model="openai/whisper-1",
        file=audio_file,
    )

print(transcript.text)
```

Use `GET /v1/models` before selecting either model. Audio formats, file limits, voices, language options, and output formats depend on the provider route.

Do not put the API key in browser or mobile code. Upload audio to your backend, or mint a purpose-built short-lived credential only when a documented flow supports it.
