> ## 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.

# Создание песни из сэмпла

> Используйте Suno сэмпл API, чтобы разворачивать короткие аудиофрагменты в более полные песни для креативной разработки, сэмплирования и музыкального прототипирования.



## OpenAPI

````yaml openapi/ru/suno.json POST /suno/v1/sample
openapi: 3.1.0
info:
  title: Документация TTAPI API
  version: 1.0.0
  description: Suno AI Музыка API
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /suno/v1/sample:
    post:
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - type: object
                  properties:
                    music_id:
                      type: string
                      description: >-
                        Идентификатор сэмпла music_id, возвращенный после
                        загрузки
                    chop_sample_start_s:
                      type: number
                      default: 0
                      description: Время начала сэмпла в секундах
                    chop_sample_end_s:
                      type: number
                      default: 60
                      description: Время окончания сэмпла в секундах
                  required:
                    - music_id
                    - chop_sample_start_s
                    - chop_sample_end_s
                    - custom
                    - instrumental
                    - mv
                - $ref: '#/components/schemas/Custom_Params'
                - $ref: '#/components/schemas/Instrumental_Params'
                - $ref: '#/components/schemas/Mv_Params'
                - $ref: '#/components/schemas/Gpt_description_prompt_Params'
                - $ref: '#/components/schemas/Prompt_Params'
                - $ref: '#/components/schemas/Title_Params'
                - $ref: '#/components/schemas/Tags_Params'
                - $ref: '#/components/schemas/Negative_tags_Params'
                - $ref: '#/components/schemas/Style_weight_Params'
                - $ref: '#/components/schemas/Weirdness_constraint_Params'
                - $ref: '#/components/schemas/Audio_weight_Params'
                - $ref: '#/components/schemas/Auto_lyrics_Params'
                - $ref: '#/components/schemas/Vocal_gender_Params'
                - $ref: '#/components/schemas/IsStorageParams'
                - $ref: '#/components/schemas/HookUrlParams'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    Custom_Params:
      type: object
      properties:
        custom:
          type: boolean
          default: false
          description: |-
            Использовать пользовательский режим.

            - **true**: Аудио будет создано на основе текста песни
            - **false**: Аудио будет создано по промптам режима вдохновения
    Instrumental_Params:
      type: object
      properties:
        instrumental:
          type: boolean
          default: false
          description: |-
            Генерировать инструментальную музыку.

            - **true**: Генерировать только инструментальную музыку
            - **false**: Генерировать трек с вокалом и текстом
              - В режиме вдохновения обязателен параметр **gpt_description_prompt**
              - В пользовательском режиме обязателен параметр **промпт**
    Mv_Params:
      type: object
      properties:
        mv:
          type: string
          default: chirp-v5
          enum:
            - chirp-v5
            - chirp-v4-5+
            - chirp-v4-5
            - chirp-v4-5-all
            - chirp-v4
            - chirp-v3-5
            - chirp-v3-0
          description: Модель для использования.
    Gpt_description_prompt_Params:
      type: object
      properties:
        gpt_description_prompt:
          type: string
          description: >-
            Промпт для режима вдохновения.


            Если пользовательский режим не используется (custom=false), этот
            параметр обязателен. Текст песни будет автоматически сгенерирован из
            этого промпта. Максимальная длина: 3000 символов.
          example: >-
            Night city lo-fi piano with rain ambience, soft vocal phrases,
            theme: "Under the city lights"
    Prompt_Params:
      type: object
      properties:
        prompt:
          type: string
          description: >-
            Текст песни.


            Используется в пользовательском режиме (custom=true). Обязателен,
            когда instrumental = false. Текст будет использован и исполнен в
            сгенерированном треке.. Максимальная длина: 5000 символов.
    Title_Params:
      type: object
      properties:
        title:
          type: string
          description: >-
            Название музыки.


            Используется в пользовательском режиме (custom=true). Максимальная
            длина: 80 символов.
    Tags_Params:
      type: object
      properties:
        tags:
          type: string
          description: >-
            Музыкальный стиль или жанр.


            Используется в пользовательском режиме (custom=true). Максимальная
            длина: 1000 символов.
          example: rock, blues, hip-hop, r&b
    Negative_tags_Params:
      type: object
      properties:
        negative_tags:
          type: string
          description: |-
            Музыкальные стили или жанры, которые нужно исключить из генерации.

            Используется в пользовательском режиме (custom=true).
    Style_weight_Params:
      type: object
      properties:
        style_weight:
          type: number
          description: >-
            Вес музыкального стиля, диапазон: 0,00–1,00.


            Используется в пользовательском режиме. Допустимый диапазон: 0 <= x
            <= 1.
          example: 0.5
    Weirdness_constraint_Params:
      type: object
      properties:
        weirdness_constraint:
          type: number
          description: >-
            Вес аудиокреативности (странности), диапазон: 0,00–1,00.


            Используется в пользовательском режиме. Допустимый диапазон: 0 <= x
            <= 1.
          example: 0.5
    Audio_weight_Params:
      type: object
      properties:
        audio_weight:
          type: number
          description: >-
            Вес звука, диапазон: 0,00–1,00.


            Используется в пользовательском режиме. Допустимый диапазон: 0 <= x
            <= 1.
          example: 0.5
    Auto_lyrics_Params:
      type: object
      properties:
        auto_lyrics:
          type: boolean
          default: false
          description: >-
            Автоматически генерировать текст. Только для пользовательского
            режима.


            - **true**: Входной текст будет креативно переписан, похожим образом
            на эффект режима вдохновения

            - **false**: Использовать предоставленный текст напрямую для
            генерации музыки
    Vocal_gender_Params:
      type: object
      properties:
        vocal_gender:
          type: string
          description: |-
            Вокальный пол.

            - Мужской: Мужской голос

            - Женский: женский голос
          enum:
            - Male
            - Female
    IsStorageParams:
      type: object
      properties:
        isStorage:
          type: boolean
          default: true
          description: |-
            Сохранять ли сгенерированный звук.

            - **true**: аудио будет сохранено и будет возвращено TTAPI CDN URL.
            - **false**: будет возвращен исходный источник URL.
    HookUrlParams:
      type: object
      properties:
        hookUrl:
          type: string
          description: URL обратного уведомления
  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: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            required:
              - status
              - message
              - data
    400Response:
      description: Ошибка параметров
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
              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>.

````