OhMyGPT API Docs
  1. Audio
OhMyGPT API Docs
  • About This site
  • About new website
  • Midjourney Open API
    • About Midjourney Service
    • Midjourney Blend Image Generation Task Creation
      POST
    • Midjourney Text-to-Image Task Creation
      POST
    • Midjourney Execute Action Task Creation
      POST
    • Midjourney Query Specific Task ID Execution Status
      POST
    • Midjourney Paginated Bulk Query Tasks
      POST
    • Midjourney Describe Prompt Extraction Task Creation
      POST
    • Retrieve Images Generated by Midjourney from Object Storage
      GET
    • Retrieve Compressed Images Generated by Midjourney from Object Storage + WSRV
      GET
    • Retrieve Images Generated by Midjourney from Object Storage + WSRV
      GET
    • Proxy Discord Images via WSRV
      GET
    • Proxy and Compress Discord Images via WSRV
      GET
  • Management API
    • Create a New API Key
      POST
    • Update API Key Information
      POST
    • Query All of User's API Keys
      POST
    • Delete Specified API Key
      POST
    • Query User Membership Expiration Date
      POST
    • User Balance Query
      POST
    • Query the current model rates
      GET
  • OpenAI
    • About OpenAI Compatible API
    • About Azure OpenAI API
    • Audio
      • Text To Speech API
        POST
    • Chat
      • Chat Completion
      • Completion (Legacy)
    • Images
      • Create Image
    • Realtime API
  • Anthropic Claude
    • Deprecated
      • ChatCompletions
      • Claude2 API
    • Anthropic Official Claude API
  • Policies
    • Terms of Service
    • Privacy Policy
  • Other OpenAPIs
    • Search API
      • Google Custom Search API
      • Google Search By Serper
    • Azure API
      • Get Azure TTS voice list
      • Azure TTS
  1. Audio

Text To Speech API

POST
/v1/audio/speech
OpenAI's latest text-to-speech (TTS) model

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/x-www-form-urlencoded
model
string 
required
One of the available TTS models: tts-1 or tts-1-hd
Example:
tts-1
input
string 
required
The text to generate audio for. The maximum length is 4096 characters.
Example:
The quick brown fox jumped over the lazy dog.
voice
string 
required
The voice to use when generating the audio. Supported voices are alloy, echo, fable, onyx, nova, shimmer
Example:
alloy
response_format
string 
optional
The format to audio in. Supported formats are mp3, opus, aac, and flac.
Example:
mp3
speed
string 
optional
The speed of the generated audio. Select a value from:[0.25, 4.0]
Example:
1

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 --request POST 'https://api.ohmygpt.com/v1/audio/speech' \
--data-urlencode 'model=tts-1' \
--data-urlencode 'input=The quick brown fox jumped over the lazy dog.' \
--data-urlencode 'voice=alloy' \
--data-urlencode 'response_format=mp3' \
--data-urlencode 'speed=1'

Responses

🟢200OK
application/json
Body
object {0}
Example
{}
Previous
About Azure OpenAI API
Next
Chat Completion
Built with