Preview: these APIs are still being designed and aren't available yet.
Skip to Content
UpskyDocs
API reference

Create speech

Speaks text aloud and returns the audio file. With a test key the audio is a second of silence, as WAV, and nothing is charged.

POST
/v1/ai/audio/speech

Speaks text aloud and returns the audio file. With a test key the audio is a second of silence, as WAV, and nothing is charged.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, starting with upsky_test_ or upsky_live_.

Request Body

application/json
  1. body

OpenAI's speech format. Other fields are ignored.

model*string

A speech model ID from GET /v1/ai/models?type=speech.

Length1 <= length <= 200
input*string

The text to speak, up to 5,000 characters. Each character is charged.

Length1 <= length <= 5000
voice?string

The voice to speak in. Each provider has its own, such as alloy for OpenAI. Without one, the model's default.

Length1 <= length <= 200
response_format?string

The audio format. Models that can't make it answer in their own, so read the Content-Type header.

Value in"mp3""opus""aac""flac""wav""pcm"
instructions?string

How to speak, such as tone or pace, on models that support it.

Lengthlength <= 4096
speed?number

From 0.25 to 4. Defaults to 1, on models that support it.

Range0.25 <= value <= 4
language?string

The language of the text, such as en, when it matters.

Length2 <= length <= 35
[key: string]?unknown

Response Body

The audio. Upsky-Cost says what it was charged, in US dollars, and Upsky-Characters how many characters were.

response?file
Formatbinary
Example Request
curl -X POST 'https://api.upsky.dev/v1/ai/audio/speech' \  -H 'Content-Type: application/json' \  -d '{  "model": "string",  "input": "string",  "property1": null,  "property2": null}'
Example Response
"string"