AITRE API Documents(English)
  1. Audio Interface(Audio)
AITRE API Documents(English)
  • AITRE Introduction
  • Project Description
  • Send Request
  • Openai's format(Chat)
    • Gpt-4o-image(Generate Image)
      POST
    • Chat Completions Interface
      POST
  • Audio Interface(Audio)
    • TTS(speech-to-text)
      POST
    • Transcriptions
      POST
    • Translations
      POST
  • Embeddings Interface(Embeddings)
    • Embeddings
    • Create Embeddings
      POST
  • Images Generations(Images)
    • Openai's format Gpt-image-1
      POST
    • Openai's format Flux
      POST
    • Openai's format DALL·E 3
      POST
  • Models Interface(Models)
    • Model
      GET
  • Auto Completions Interface(Completions)
    • Completions
      POST
  • MidJourney
    • Description
    • Fetch task by id
      GET
    • Action
      POST
    • Blend(image to image)
      POST
    • Describe (image to text)
      POST
    • Imagine (text to image/image to image)
      POST
    • Modal(Partial redrawing、ZOOM)
      POST
    • Shorten(prompt analysis)
      POST
  1. Audio Interface(Audio)

TTS(speech-to-text)

POST
{{BASE_URL}}/v1/audio/speech
Transcribe input text into audio.

Request

Header Params
Authorization
string 
required
Provide your bearer token in the Authorization header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Example:
Bearer {{YOUR_API_KEY}}
Body Params application/json
model
string 
required
One of the available TTS models: tts-1 or tts-1-hd
input
string 
required
To generate audio text. The maximum length is 4096 characters.
voice
string 
required
The speech used when generating audio. The supported voices include: alloy, echo, fable, onyx, nova, and shim.
response_format
string 
optional
文件
图片
41/10000
实时翻译
划译
The default format is MP3 audio. The supported formats are: mp3, opus, aac, and flac.
speed
number 
optional
The default generated audio speed is 1. Choose a value between 0.25 and 4.0. 1.0 is the default value.
Example
{
  "model": "tts",
  "input": "The quick brown fox jumped over the lazy dog.",
  "voice": "alloy"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '{{BASE_URL}}/v1/audio/speech' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "model": "tts",
    "input": "The quick brown fox jumped over the lazy dog.",
    "voice": "alloy"
  }'

Responses

🟢200成功
application/json
Body
object {0}
Example
{}
Modified at 2025-03-30 03:28:08
Previous
Chat Completions Interface
Next
Transcriptions
Built with