> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vmeg.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Synthesize speech (sync)

> Convert text to speech in one request. Audio URLs are returned immediately in the HTTP `data` payload — no webhook required.



## OpenAPI

````yaml /api-reference/openapi.json post /openapi/v1/task/tts/create
openapi: 3.1.0
info:
  title: VMEG Open API
  description: >-
    Integrate VMEG into your product: translate and dub video or audio,
    synthesize speech, clone voices, translate plain text, and manage API-side
    files. All responses use `{ code, message, data }`; `code === 200` means
    success.
  version: 1.0.0
servers:
  - url: https://api.vmeg.ai
    description: Production
security:
  - apiKeyAuth: []
tags:
  - name: Media translation
    x-group: Video & audio translate and dub
    description: >-
      Localize uploaded video or audio end-to-end: transcribe speech, translate
      the script, generate AI dubbing (cloned or preset voices), and return new
      dubbed media. Optional subtitles and lip sync. **Async only** — dubbed
      files arrive via [Webhook](/guides/webhooks). This is not plain text
      translation; see [Media translation](/guides/products/media-translation).
  - name: TTS
    x-group: Text to speech (TTS)
    description: >-
      Turn text into natural speech with preset or cloned voices. **Sync**
      returns audio URLs in the HTTP response; **async** delivers results via
      [Webhook](/guides/webhooks). See [Text to
      speech](/guides/products/text-to-speech).
  - name: Voice clone
    x-group: Voice cloning
    description: >-
      Create a reusable voice from a short reference recording. Returns a
      `voiceId` you can pass to TTS or translate-and-dub jobs. See [Voice
      clone](/guides/products/voice-clone).
  - name: Text translation
    x-group: Text translation (text only)
    description: >-
      Translate plain text segments — no audio or video processing. For spoken
      content in media files, use **Video & audio translate and dub** instead.
      See [Text translation](/guides/products/text-translation).
  - name: Task management
    x-group: Task status and history
    description: >-
      List, inspect, or delete jobs created through any product API. Poll `GET
      .../tasks/detail` when you cannot rely on webhooks. Scoped to your **API
      Key**. See [Products overview](/guides/products/overview).
  - name: Assets - Materials
    x-group: Upload files (materials)
    description: >-
      Upload and manage video/audio files used as input for translate-and-dub
      jobs. Flow: presigned upload → register material → pass `materialId` to
      create-async. See [Material upload](/guides/assets/material-upload).
  - name: Assets - Voices
    x-group: Voices (presets and clones)
    description: >-
      List preset voices for TTS, or manage voices you cloned. Cloned voices are
      created via **Voice cloning**. See [Voices](/guides/assets/voices).
paths:
  /openapi/v1/task/tts/create:
    post:
      tags:
        - TTS
      summary: Synthesize speech (sync)
      description: >-
        Convert text to speech in one request. Audio URLs are returned
        immediately in the HTTP `data` payload — no webhook required.
      operationId: ttsCreateSync
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyRequired'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OpenApiTtsCreateRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenApiTtsCreateResponse'
components:
  parameters:
    IdempotencyKeyRequired:
      name: X-Idempotency-Key
      in: header
      required: true
      description: >-
        Required on mutating `POST` requests that create tasks or change
        persisted data (max 64 characters). See
        [Idempotency](/guides/idempotency).
      schema:
        type: string
        maxLength: 64
  schemas:
    OpenApiTtsCreateRequest:
      type: object
      required:
        - data
      properties:
        provider:
          type: string
          deprecated: true
          description: >-
            Deprecated — do not send. Pass `voiceId` on each line instead. See
            [Text to speech](/guides/products/text-to-speech) and [Supported
            clone
            methods](/guides/supported-clone-methods#text-to-speech-voiceid-and-batch-rules).
        language:
          type: object
          properties:
            target:
              type: string
              example: en-US
              description: >-
                Target locale (BCP-47). See [Supported
                languages](/guides/supported-languages).
          description: Target language for synthesis
        trim:
          type: boolean
          default: false
          description: When `true`, trim leading and trailing silence from output audio
        data:
          type: array
          maxItems: 50
          items:
            $ref: '#/components/schemas/OpenApiTtsDataItem'
          description: >-
            Lines to synthesize (max 50). Each item needs `text` and a
            [Voices](/guides/assets/voices) `voiceId` or `timbreRefAudio`
        outputFormat:
          type: string
          enum:
            - wav
            - mp3
            - m4a
          default: m4a
          description: 'Output audio container: `wav`, `mp3`, or `m4a`'
    OpenApiTtsCreateResponse:
      allOf:
        - $ref: '#/components/schemas/OpenApiResponseBase'
        - type: object
          properties:
            data:
              description: Synthesis results returned in the synchronous HTTP response.
              allOf:
                - $ref: '#/components/schemas/OpenApiTtsCreateData'
    OpenApiTtsDataItem:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          description: Text to synthesize
        voiceId:
          type: string
          description: >-
            System or cloned voice ID for this line. See
            [Voices](/guides/assets/voices); or use `timbreRefAudio` instead
        timbreRefAudio:
          type: string
          description: >-
            HTTPS reference audio when not using a
            [Voices](/guides/assets/voices) `voiceId`
        emoWeight:
          type: number
          minimum: 0
          maximum: 1
          description: Emotion strength from `emoRefAudio` / `emoPrompt` (0–1)
        emoRefAudio:
          type: string
          description: HTTPS URL of reference audio for emotion or delivery style
        emoPrompt:
          type: string
          description: Text hint for desired emotion or speaking style
        duration:
          type: number
          description: Target duration in seconds
    OpenApiResponseBase:
      type: object
      properties:
        code:
          type: integer
          example: 200
          description: Business code; 200 means success
        message:
          type: string
          example: ''
          description: Human-readable detail when `code` is not success
      required:
        - code
    OpenApiTtsCreateData:
      type: object
      properties:
        taskId:
          type: string
          description: Open API task ID
        results:
          type: array
          items:
            $ref: '#/components/schemas/OpenApiTtsResultItem'
          description: Synthesis result items
        createdAt:
          type: string
          description: Task creation time (ISO 8601)
    OpenApiTtsResultItem:
      type: object
      properties:
        uri:
          type: string
          description: Synthesized audio URL (HTTPS)
        duration:
          type: number
          description: Duration in seconds
        errorMessage:
          type: string
          description: Failure reason when synthesis failed for this item
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        Send your API Key in the **`Authorization`** header (`Bearer
        <api_key>`). See [Authentication](/guides/authentication).

````