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

# Text To Speech

> Generate a speech from a text

## Pricing

* **Cost**: 1 credits per character

> ⚠️ **Important Notes**
>
> * The generated audio file will expire after 12 hours. Please download and save it promptly.


## OpenAPI

````yaml POST /v1/tts
openapi: 3.0.1
info:
  title: voicv-api
  description: ''
  version: 1.0.0
servers:
  - url: https://api.voicv.com
    description: production
security: []
tags: []
paths:
  /v1/tts:
    post:
      tags: []
      summary: Text to Speech
      parameters:
        - name: x-api-key
          in: header
          description: ''
          required: true
          example: '{{apiKey}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                voiceId:
                  type: string
                  description: ID of the voice to be used for the speech
                text:
                  type: string
                  description: Text to be converted to speech
                format:
                  type: string
                  description: >-
                    Format to be used for the speech, Available options: wav,
                    pcm, mp3, opus
              required:
                - voiceId
                - text
                - format
            example:
              voiceId: 8c97bbb2ff424bb1a580651576774d2d
              text: >-
                Voicv is a cutting-edge voice cloning platform that transforms
                your voice into a digital asset in minutes, supporting multiple
                languages and zero-shot learning.
              format: mp3
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      audioUrl:
                        type: string
                      costCredits:
                        type: integer
                    required:
                      - audioUrl
                      - costCredits
                required:
                  - code
                  - message
                  - data
              examples:
                '1':
                  summary: 成功示例
                  value:
                    code: 200
                    message: success
                    data:
                      audioUrl: >-
                        https://r2-api.voicv.com/568e3c588b55479baf7591c17554d8f8.mp3
                      costCredits: 160
          headers: {}
      deprecated: false
      security: []

````