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

# Замена фрагмента

> Заменить некоторые сегменты сгенерированного звука



## OpenAPI

````yaml openapi/ru/producer.json POST /producer/v1/replace
openapi: 3.1.0
info:
  title: Документация Producer API
  version: 1.0.0
  description: TTAPI Producer API сервис
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /producer/v1/replace:
    post:
      description: Заменить некоторые сегменты сгенерированного звука
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    ReplaceRequest:
      type: object
      properties:
        music_id:
          type: string
          description: Идентификатор музыки родительской задачи
        sound_prompt:
          type: string
          description: >-
            Звуковая подсказка: sound_prompt и lyrics_text не могут быть
            пустыми.
        lyrics_text:
          type: string
          description: Текст текста, sound_prompt и lyrics_text не могут быть пустыми.
        instrumental:
          type: boolean
          description: Создавать ли чистую музыку
          default: 'false'
        starts:
          type: number
          example:
            - '30.01'
          description: Указывает начало замены с x секунд исходного звука.
        ends:
          type: number
          description: Время окончания заменяющего сегмента (секунды)
        mv:
          type: string
          default: FUZZ-2.0
          enum:
            - FUZZ-2.0 Pro
            - FUZZ-2.0
            - FUZZ-2.0 Raw
            - FUZZ-1.1 Pro
            - FUZZ-1.0 Pro
            - FUZZ-1.0
            - FUZZ-1.1
            - FUZZ-0.8
            - Lyria 3 preview
          description: Используемая модель, поддерживаемые параметры перечислены выше.
        title:
          type: string
          description: Заголовок
        cover_art_url:
          type: string
          description: Обложка URL
        seed:
          type: string
          description: Случайный исходное значение
        lyrics_strength:
          type: number
          description: Сила текста, необязательно 0-1
          default: '0.5'
        sound_strength:
          type: number
          description: Уровень звуковой подсказки, опционально 0.2-1
          default: '0.5'
        weirdness:
          type: number
          description: Странность стиля, необязательно 0-1
          default: '0.5'
        is_storage:
          type: boolean
          description: Стоит ли сохранять
          default: 'false'
        hook_url:
          type: string
          description: >-
            Уведомление об обратном вызове URL. Возвращенные данные
            соответствуют ответу на запрос результата задачи.
      required:
        - music_id
        - sound_prompt
        - lyrics_text
  responses:
    SuccessResponse:
      description: Запрос выполнен успешно
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: jobId
            required:
              - status
              - message
              - data
    400Response:
      description: Ошибка параметров
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Ошибка авторизации
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        Вы можете получить API-ключ в <a href='https://dashboard.ttapi.io'
        target='_blank'>панель управления TTAPI</a>.

````