VoiceOver & Text to Speech

VoiceOver & Text to Speech · Ações GPT

Text to Speech API

  • POST /api/speech/createConvert text to speech
Esquema API original
{
  "openapi": "3.1.0",
  "info": {
    "title": "Text to Speech API",
    "version": "1.1.8"
  },
  "servers": [
    {
      "url": "https://speech.maila.ai"
    }
  ],
  "paths": {
    "/api/speech/create": {
      "post": {
        "operationId": "convertTextToSpeech",
        "summary": "Convert text to speech",
        "x-openai-isConsequential": false,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "input": {
                    "type": "string",
                    "description": "The spoken text to be converted to speech as a string."
                  },
                  "locale": {
                    "type": "string",
                    "description": "The locale of the text, following the BCP-47 format.",
                    "pattern": "^[a-z]{2,3}(-[A-Za-z0-9]{1,8})*$"
                  },
                  "gender": {
                    "type": "string",
                    "enum": [
                      "male",
                      "female"
                    ],
                    "default": "male",
                    "description": "The gender of the narrator as a string."
                  },
                  "narratorName": {
                    "type": "string",
                    "default": "auto",
                    "description": "The name of the narrator by whom the audio should be created. The name must be same during the conversation unless the user asks for a different name. If no narrator name is provided by user, then use 'auto' to automatically select the suitable narrator name."
                  },
                  "age": {
                    "type": "string",
                    "enum": [
                      "young-adult",
                      "middle-aged",
                      "senior"
                    ],
                    "description": "The age group of the narrator."
                  },
                  "category": {
                    "type": "string",
                    "enum": [
                      "storytelling",
                      "character_animation",
                      "social_media",
                      "advertisement",
                      "broadcast",
                      "e-learning",
                      "conversationl",
                      "documentary"
                    ],
                    "description": "The speaking style and tone for the generated speech audio."
                  },
                  "timbre": {
                    "type": "string",
                    "description": "Describe the timbre or color of the voice that will best suit the context."
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Detailed specific instructions on how the text should be read, including rhythm, accent, timbre, delivery style, emotional palette, vocal features, emphasis, tone variations and other nuanced speech characteristics."
                  },
                  "delivery_style": {
                    "type": "string",
                    "enum": [
                      "formal",
                      "balanced",
                      "engaging",
                      "performed"
                    ],
                    "description": "The delivery style of the speech."
                  },
                  "extra_tips": {
                    "type": "string",
                    "description": "Any other style notes or tips for the speech."
                  }
                },
                "required": [
                  "input",
                  "locale",
                  "gender",
                  "narratorName",
                  "category",
                  "timbre",
                  "instructions"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "link": {
                      "type": "string",
                      "description": "The URL of the audio file."
                    },
                    "note": {
                      "type": "string",
                      "description": "Any notes about the audio link file."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Authentication Required"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "503": {
            "description": "The server is temporarily unavailable to handle your request. Please try again later."
          }
        }
      }
    }
  }
}