Video Maker - Easy and Free

Video Maker - Easy and Free · Acciones GPT

ChangeBlogger TTS API

Text-to-speech endpoints powered by edge-tts. These endpoints require an API key in the X-API-Key header.

  • POST /tts/gptGenerate speech audio (GPT Actions compatible)

    Generates MP3 audio from text and returns it as a base64-encoded file inside the openaiFileResponse JSON envelope, compatible with ChatGPT GPT custom actions.

  • GET /tts/voicesList available TTS voices

    Returns available voices, optionally filtered by language and gender.

Esquema original API
{
  "openapi": "3.1.0",
  "info": {
    "title": "ChangeBlogger TTS API",
    "version": "1.0.0",
    "description": "Text-to-speech endpoints powered by edge-tts.\nThese endpoints require an API key in the X-API-Key header.\n"
  },
  "servers": [
    {
      "url": "https://api.changeblogger.org"
    }
  ],
  "tags": [
    {
      "name": "TTS",
      "description": "Text-to-speech endpoints"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "TTSRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Text to synthesize.",
            "minLength": 1,
            "maxLength": 5000,
            "examples": [
              "Hello from the protected TTS endpoint"
            ]
          },
          "language": {
            "type": "string",
            "description": "ISO 639-1 language code or supported short language key.",
            "default": "en",
            "examples": [
              "en",
              "hi",
              "fr"
            ]
          },
          "gender": {
            "type": "string",
            "description": "Voice gender.",
            "enum": [
              "male",
              "female"
            ],
            "default": "female"
          },
          "rate": {
            "type": "string",
            "description": "Speech rate adjustment.",
            "default": "+0%",
            "examples": [
              "+0%",
              "+10%",
              "-10%"
            ]
          },
          "pitch": {
            "type": "string",
            "description": "Pitch adjustment.",
            "default": "+0Hz",
            "examples": [
              "+0Hz",
              "+5Hz",
              "-5Hz"
            ]
          }
        }
      },
      "Voice": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "language",
          "locale",
          "gender"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Full edge-tts voice name.",
            "examples": [
              "en-US-AvaNeural"
            ]
          },
          "language": {
            "type": "string",
            "description": "Language code.",
            "examples": [
              "en"
            ]
          },
          "locale": {
            "type": "string",
            "description": "Locale code.",
            "examples": [
              "en-US"
            ]
          },
          "gender": {
            "type": "string",
            "enum": [
              "Male",
              "Female"
            ]
          }
        }
      },
      "OpenAIFileItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "mime_type",
          "content"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Filename of the generated audio file.",
            "examples": [
              "speech.mp3"
            ]
          },
          "mime_type": {
            "type": "string",
            "description": "MIME type of the file.",
            "examples": [
              "audio/mpeg"
            ]
          },
          "content": {
            "type": "string",
            "description": "Base64-encoded file content."
          }
        }
      },
      "OpenAIFileResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "openaiFileResponse"
        ],
        "properties": {
          "openaiFileResponse": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpenAIFileItem"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/tts/gpt": {
      "post": {
        "tags": [
          "TTS"
        ],
        "operationId": "textToSpeechGpt",
        "summary": "Generate speech audio (GPT Actions compatible)",
        "description": "Generates MP3 audio from text and returns it as a base64-encoded file\ninside the openaiFileResponse JSON envelope, compatible with ChatGPT\nGPT custom actions.\n",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TTSRequest"
              },
              "examples": {
                "englishFemale": {
                  "summary": "English female voice",
                  "value": {
                    "text": "Hello from the GPT-compatible TTS endpoint",
                    "language": "en",
                    "gender": "female"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Base64-encoded MP3 audio in openaiFileResponse envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAIFileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, unsupported gender, unsupported language, or text too long",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Voice resolution failure, speech generation failure, or server misconfiguration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/tts/voices": {
      "get": {
        "tags": [
          "TTS"
        ],
        "operationId": "listTtsVoices",
        "summary": "List available TTS voices",
        "description": "Returns available voices, optionally filtered by language and gender.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "required": false,
            "description": "ISO 639-1 language code, such as en or hi.",
            "schema": {
              "type": "string",
              "examples": [
                "en",
                "hi"
              ]
            }
          },
          {
            "name": "gender",
            "in": "query",
            "required": false,
            "description": "Voice gender filter.",
            "schema": {
              "type": "string",
              "enum": [
                "male",
                "female"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of available voices",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Voice"
                  }
                },
                "examples": {
                  "sample": {
                    "value": [
                      {
                        "name": "en-US-AvaNeural",
                        "language": "en",
                        "locale": "en-US",
                        "gender": "Female"
                      },
                      {
                        "name": "en-US-AndrewNeural",
                        "language": "en",
                        "locale": "en-US",
                        "gender": "Male"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid gender filter",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "invalidGender": {
                    "value": {
                      "error": "'gender' must be 'male' or 'female'."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "missingHeader": {
                    "value": {
                      "error": "Missing X-API-Key header."
                    }
                  },
                  "invalidKey": {
                    "value": {
                      "error": "Invalid API key."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Failed to fetch voices or server misconfiguration",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "examples": {
                  "serverKeyMissing": {
                    "value": {
                      "error": "TTS API key is not configured on the server."
                    }
                  },
                  "listFailure": {
                    "value": {
                      "error": "Failed to fetch voices."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}