vennaVenna

Audio and speech

Synthesize speech with the TTS endpoint and transcribe or translate audio with the STT endpoints.

The gateway speaks OpenAI's audio API in both directions — text in, speech out at /v1/audio/speech, and speech in, text out at /v1/audio/transcriptions / /v1/audio/translations.

Metering differs by direction

TTS bills the input characters you send. STT bills the audio seconds you upload — the estimate reserved at request time reconciles to the duration the model reports.

Text-to-speech

POST /v1/audio/speech converts text to audio bytes. Live models: kokoro and chatterbox — swap model between them for a different voice engine; the request and response shapes are identical.

Prop

Type

import fs from "node:fs";
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://gateway.venna.net/v1",
  apiKey: process.env.VENNA_API_KEY,
});

const speech = await client.audio.speech.create({
  model: "kokoro",
  input: "Venna routes requests to whichever node is fastest.",
  voice: "alloy",
  response_format: "mp3",
});

const bytes = Buffer.from(await speech.arrayBuffer());
fs.writeFileSync("speech.mp3", bytes);
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.venna.net/v1",
    api_key=os.environ["VENNA_API_KEY"],
)

speech = client.audio.speech.create(
    model="kokoro",
    input="Venna routes requests to whichever node is fastest.",
    voice="alloy",
    response_format="mp3",
)

speech.write_to_file("speech.mp3")
curl https://gateway.venna.net/v1/audio/speech \
  -H "Authorization: Bearer $VENNA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kokoro",
    "input": "Venna routes requests to whichever node is fastest.",
    "voice": "alloy",
    "response_format": "mp3"
  }' \
  --output speech.mp3

Speech-to-text

POST /v1/audio/transcriptions takes a multipart/form-data body — the audio file and a model — and returns { "text": "..." }. The live model is whisper-large-v3.

import fs from "node:fs";
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://gateway.venna.net/v1",
  apiKey: process.env.VENNA_API_KEY,
});

const transcription = await client.audio.transcriptions.create({
  file: fs.createReadStream("audio.mp3"),
  model: "whisper-large-v3",
});

console.log(transcription.text);
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.venna.net/v1",
    api_key=os.environ["VENNA_API_KEY"],
)

with open("audio.mp3", "rb") as audio_file:
    transcription = client.audio.transcriptions.create(
        model="whisper-large-v3",
        file=audio_file,
    )

print(transcription.text)
curl https://gateway.venna.net/v1/audio/transcriptions \
  -H "Authorization: Bearer $VENNA_API_KEY" \
  -F file="@audio.mp3" \
  -F model="whisper-large-v3"

Add response_format to change the shape of the response:

Prop

Type

Translations output English, always

POST /v1/audio/translations takes the same file + model body — no language field — and runs on the same whisper-large-v3 model. Whatever language the audio is in, the text it returns is English. Point translation jobs there instead of /v1/audio/transcriptions when you want an English transcript regardless of source language.

Next steps

  • API reference: Audio — every field, response format, and error code for the three endpoints.
  • Quickstart — pointing the OpenAI SDKs and curl at the gateway in general.

On this page