Endpoints
Speech (TTS)
Turn text into audio with POST /audio/speech on api14, choosing voices, models and output formats for narration, assistants and accessibility.
Try it in the playgroundTurn text into natural-sounding speech (text-to-speech, TTS). The endpoint follows OpenAI's POST /audio/speech shape and returns raw audio bytes, so client.audio.speech.create(...) works unchanged.
POST https://api14.com/api/v1/audio/speech
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | yes | A speech model id, e.g. openai/gpt-4o-mini-tts. |
input | string | yes | The text to speak. |
voice | string | yes | Voice name, e.g. alloy, nova, verse. Voices vary per model (see the model page). |
response_format | string | no | mp3 (default), wav, opus, aac, flac, pcm where supported. |
speed | number | no | Playback speed, typically 0.25–4.0. |
instructions | string | no | Style guidance for models that accept it ("calm, warm tone"). |
Example
import { writeFile } from "node:fs/promises";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api14.com/api/v1",
apiKey: process.env.API14_API_KEY,
});
const audio = await client.audio.speech.create({
"model": "openai/gpt-4o-mini-tts",
"input": "Hello from api14! One API for every model.",
"voice": "alloy",
"response_format": "mp3"
});
await writeFile("speech.mp3", Buffer.from(await audio.arrayBuffer()));
Response
The body is the audio file itself, with a matching Content-Type (e.g. audio/mpeg). Save it to disk or stream it to a player:
curl https://api14.com/api/v1/audio/speech \
-H "Authorization: Bearer sk-api14-..." \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-mini-tts","input":"Hello from api14!","voice":"alloy"}' \
--output hello.mp3
Errors are still returned as JSON in the OpenAI error shape, so check the status code before writing the file.
Pricing
Speech is billed per input character at the model's listed price, displayed as "$ / 1M characters". A 1,000-character paragraph on a model priced at $15 / 1M characters costs $0.015.
Listing speech models
curl "https://api14.com/api/v1/models?category=speech"
Errors
| Status | Code | When |
|---|---|---|
| 400 | model_required / invalid_json | Missing model or malformed body. |
| 402 | insufficient_balance | Your USD balance is $0. |
| 403 | model_not_allowed / plan_required | Key allowlist or plan excludes the model. |
| 404 | model_not_found | Unknown or disabled model id. |
| 429 | rate_limited | Requests per minute exceeded. |
Unsupported voices or formats are rejected upstream and passed through. See Errors.