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

# Tạo tác vụ tạo nhạc hoặc âm thanh

> API gửi yêu cầu tạo nhạc và âm thanh, tương thích với đường dẫn cũ `/suno/submit/music`. Trả về ID tác vụ, sau đó truy vấn qua `/suno/fetch/{task_id}`.

API gửi tác vụ tạo nhạc và âm thanh. Đường dẫn giữ nguyên `/suno/submit/music`, thực tế có thể chọn engine tạo qua `upstream_model`, `music_model`, `engine`, `model_id` hoặc `modelId`. API tạo trả về `task_id`, sau đó dùng `/suno/fetch/{task_id}` để truy vấn đầu ra.

Khi không truyền `upstream_model` (hoặc chỉ truyền `{"model":"suno_music"}`), mặc định dùng Suno v5.5. Nếu cần tiếp tục dùng phiên bản Suno cũ, vui lòng truyền rõ `"upstream_model":"suno-v5"`.

## Mô hình mới

| Loại | `upstream_model` / Biệt danh | `modelId` |
| --- | --- | ---: |
| Âm nhạc | `suno-v5.5` / `chirp-fenix` | 128 |
| Âm thanh | `seed-audio-1.0` | 126 |
| Âm thanh | `minimax-speech-2.8-hd` / `speech-2.8-hd` | 127 |
| Âm nhạc | `lyria-3-pro` / `lyria-3-pro-preview` | 129 |

## Chế độ mô tả prompt

Phù hợp khi chỉ mô tả phong cách, cảm xúc, ngôn ngữ, kiểu giọng hát và bối cảnh; mô hình sẽ tự động tạo nội dung bài hát.

```json
{
  "model": "suno_music",
  "upstream_model": "suno-v5.5",
  "prompt": "Create an energetic retro-pop DJ song about the artificial intelligence revolution.",
  "make_instrumental": false
}
```

## Tạo âm thanh

MiniMax Speech có thể ghi đè các tham số giọng nói thông qua `extraParams` (hoặc trường trùng tên dạng snake_case/camelCase ở cấp cao nhất).

```json
{
  "model": "suno_music",
  "upstream_model": "minimax-speech-2.8-hd",
  "prompt": "欢迎使用新版语音生成服务。",
  "extraParams": {
    "voice": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85",
    "outputFormat": "mp3",
    "sampleRate": 32000,
    "speed": 1,
    "volume": 1,
    "pitch": 0
  }
}
```

Khi MiniMax Speech không truyền tham số giọng nói, máy chủ mặc định gửi các giá trị `voice`, `outputFormat=mp3`, `sampleRate=32000`, `speed=1`, `volume=1` và `pitch=0` như trong ví dụ trên.

Lyria 3 Pro sử dụng `upstream_model=lyria-3-pro` (hoặc `lyria-3-pro-preview`):

```json
{
  "model": "suno_music",
  "upstream_model": "lyria-3-pro",
  "prompt": "Cinematic orchestral music with a hopeful finale."
}
```

## Nhạc nhẹ hoặc nhạc nền không lời

Có thể dùng `light_music=true` hoặc `make_instrumental=true`. `light_music` biểu thị thiên về nhạc nhẹ/nhạc nền, `make_instrumental` biểu thị không tạo giọng hát.

```json
{
  "model": "suno_music",
  "upstream_model": "minimax-music-v2.6",
  "prompt": "Warm cafe background music with soft piano and strings, relaxing and cinematic.",
  "light_music": true,
  "make_instrumental": true
}
```

## Chế độ nâng cao cho lời bài hát

Phù hợp khi phía nghiệp vụ đã chuẩn bị sẵn lời bài hát và cần chỉ định tiêu đề cùng thẻ phong cách. Có thể truyền `custom_mode=true`, trường lời bài hát có thể dùng `lyrics`, `lyric`, `custom_lyrics` hoặc `customLyrics`.

```json
{
  "model": "suno_music",
  "upstream_model": "mureka-v9",
  "custom_mode": true,
  "title": "Summer Sea Breeze",
  "tags": "electro pop, female vocal, bright summer",
  "lyrics": "[Verse]\nSea breeze moves across the white sand\n[Chorus]\nTurn the summer into a beam of light"
}
```

## Truy vấn

Sau khi tạo thành công, hãy lưu lại `data` task ID được trả về, ví dụ `task_xxx`, rồi gọi `GET /suno/fetch/{task_id}` để truy vấn trạng thái, địa chỉ âm thanh, ảnh bìa, tiêu đề, lời bài hát và thông tin đoạn dữ liệu gốc do upstream trả về.



## OpenAPI

````yaml api-reference/vi/openapi.json POST /suno/submit/music
openapi: 3.0.0
info:
  title: Tài liệu tham khảo API của 出海营
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
security:
  - BearerAuth: []
tags:
  - name: Định dạng OpenAI (Chat)
  - name: Định dạng OpenAI (Responses)
  - name: Định dạng Gemini cho tạo ảnh
  - name: Tạo hình ảnhOpenAI định dạng DALL-E
  - name: Lấy danh sách mô hình
  - name: Tạo video HappyHorse và Wan
  - name: Định dạngKling tạo video
  - name: Định dạng Video Generation Omni và Veo
  - name: Tạo video Seedance
  - name: Định dạng tương thích Sora cho tạo video
  - name: Tạo video Vidu
  - name: Định dạng tác vụ tạo nhạc
paths:
  /suno/submit/music:
    post:
      tags:
        - Định dạng tác vụ tạo nhạc
      summary: Tạo tác vụ tạo nhạc hoặc âm thanh
      description: >-
        API gửi yêu cầu tạo nhạc và âm thanh, tương thích với đường dẫn cũ
        `/suno/submit/music`. Trả về ID tác vụ, sau đó truy vấn qua
        `/suno/fetch/{task_id}`.


        API gửi tác vụ tạo nhạc và âm thanh. Đường dẫn giữ nguyên
        `/suno/submit/music`, thực tế có thể chọn engine tạo qua
        `upstream_model`, `music_model`, `engine`, `model_id` hoặc `modelId`.
        API tạo trả về `task_id`, sau đó dùng `/suno/fetch/{task_id}` để truy
        vấn đầu ra.


        Khi không truyền `upstream_model` (hoặc chỉ truyền
        `{"model":"suno_music"}`), mặc định dùng Suno v5.5. Nếu cần tiếp tục
        dùng phiên bản Suno cũ, vui lòng truyền rõ `"upstream_model":"suno-v5"`.


        ## Mô hình mới


        | Loại | `upstream_model` / Biệt danh | `modelId` |

        | --- | --- | ---: |

        | Âm nhạc | `suno-v5.5` / `chirp-fenix` | 128 |

        | Âm thanh | `seed-audio-1.0` | 126 |

        | Âm thanh | `minimax-speech-2.8-hd` / `speech-2.8-hd` | 127 |

        | Âm nhạc | `lyria-3-pro` / `lyria-3-pro-preview` | 129 |


        ## Chế độ mô tả prompt


        Phù hợp khi chỉ mô tả phong cách, cảm xúc, ngôn ngữ, kiểu giọng hát và
        bối cảnh; mô hình sẽ tự động tạo nội dung bài hát.


        ```json

        {
          "model": "suno_music",
          "upstream_model": "suno-v5.5",
          "prompt": "Create an energetic retro-pop DJ song about the artificial intelligence revolution.",
          "make_instrumental": false
        }

        ```


        ## Tạo âm thanh


        MiniMax Speech có thể ghi đè các tham số giọng nói thông qua
        `extraParams` (hoặc trường trùng tên dạng snake_case/camelCase ở cấp cao
        nhất).


        ```json

        {
          "model": "suno_music",
          "upstream_model": "minimax-speech-2.8-hd",
          "prompt": "欢迎使用新版语音生成服务。",
          "extraParams": {
            "voice": "moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85",
            "outputFormat": "mp3",
            "sampleRate": 32000,
            "speed": 1,
            "volume": 1,
            "pitch": 0
          }
        }

        ```


        Khi MiniMax Speech không truyền tham số giọng nói, máy chủ mặc định gửi
        các giá trị `voice`, `outputFormat=mp3`, `sampleRate=32000`, `speed=1`,
        `volume=1` và `pitch=0` như trong ví dụ trên.


        Lyria 3 Pro sử dụng `upstream_model=lyria-3-pro` (hoặc
        `lyria-3-pro-preview`):


        ```json

        {
          "model": "suno_music",
          "upstream_model": "lyria-3-pro",
          "prompt": "Cinematic orchestral music with a hopeful finale."
        }

        ```


        ## Nhạc nhẹ hoặc nhạc nền không lời


        Có thể dùng `light_music=true` hoặc `make_instrumental=true`.
        `light_music` biểu thị thiên về nhạc nhẹ/nhạc nền, `make_instrumental`
        biểu thị không tạo giọng hát.


        ```json

        {
          "model": "suno_music",
          "upstream_model": "minimax-music-v2.6",
          "prompt": "Warm cafe background music with soft piano and strings, relaxing and cinematic.",
          "light_music": true,
          "make_instrumental": true
        }

        ```


        ## Chế độ nâng cao cho lời bài hát


        Phù hợp khi phía nghiệp vụ đã chuẩn bị sẵn lời bài hát và cần chỉ định
        tiêu đề cùng thẻ phong cách. Có thể truyền `custom_mode=true`, trường
        lời bài hát có thể dùng `lyrics`, `lyric`, `custom_lyrics` hoặc
        `customLyrics`.


        ```json

        {
          "model": "suno_music",
          "upstream_model": "mureka-v9",
          "custom_mode": true,
          "title": "Summer Sea Breeze",
          "tags": "electro pop, female vocal, bright summer",
          "lyrics": "[Verse]\nSea breeze moves across the white sand\n[Chorus]\nTurn the summer into a beam of light"
        }

        ```


        ## Truy vấn


        Sau khi tạo thành công, hãy lưu lại `data` task ID được trả về, ví dụ
        `task_xxx`, rồi gọi `GET /suno/fetch/{task_id}` để truy vấn trạng thái,
        địa chỉ âm thanh, ảnh bìa, tiêu đề, lời bài hát và thông tin đoạn dữ
        liệu gốc do upstream trả về.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  example: suno_music
                  description: Luôn truyền `suno_music`.
                  enum:
                    - suno_music
                upstream_model:
                  type: string
                  example: suno-v5.5
                  description: >-
                    Giá trị chọn của công cụ tạo; mặc định `suno-v5.5`, truyền
                    rõ ràng `suno-v5` có thể giữ phiên bản cũ.
                music_model:
                  type: string
                  description: Tên bí danh tương thích của `upstream_model`.
                engine:
                  type: string
                  description: Tên bí danh tương thích của `upstream_model`.
                model_id:
                  oneOf:
                    - type: string
                    - type: integer
                  description: Trường tương thích camelCase của `model_id`.
                modelId:
                  oneOf:
                    - type: string
                    - type: integer
                  description: Trường tương thích camelCase của `model_id`.
                prompt:
                  type: string
                  description: >-
                    Trong chế độ mô tả prompt, dùng cho phong cách âm nhạc, tâm
                    trạng và bối cảnh; trong chế độ nâng cao của lời bài hát, có
                    thể dùng làm trường tương thích với lời bài hát.
                gpt_description_prompt:
                  type: string
                  description: Mô tả trường tương thích với prompt của chế độ.
                extraParams:
                  type: object
                  description: >-
                    Tham số giọng nói của MiniMax Speech 2.8 HD; là trường tương
                    thích snake_case của `extraParams`.
                  properties:
                    voice:
                      type: string
                      default: moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85
                    outputFormat:
                      type: string
                      default: mp3
                    sampleRate:
                      type: integer
                      default: 32000
                    speed:
                      type: number
                      default: 1
                    volume:
                      type: number
                      default: 1
                    pitch:
                      type: number
                      default: 0
                  additionalProperties: true
                extra_params:
                  type: object
                  description: >-
                    Tham số giọng nói của MiniMax Speech 2.8 HD; là trường tương
                    thích snake_case của `extraParams`.
                  properties:
                    voice:
                      type: string
                      default: moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85
                    outputFormat:
                      type: string
                      default: mp3
                    sampleRate:
                      type: integer
                      default: 32000
                    speed:
                      type: number
                      default: 1
                    volume:
                      type: number
                      default: 1
                    pitch:
                      type: number
                      default: 0
                  additionalProperties: true
                voice:
                  type: string
                  description: >-
                    Tông giọng MiniMax Speech 2.8 HD, có thể bao phủ
                    `extraParams.voice`.
                output_format:
                  type: string
                  description: Định dạng đầu ra của MiniMax Speech 2.8 HD.
                outputFormat:
                  type: string
                  description: Trường tương thích camelCase của `output_format`.
                sample_rate:
                  type: integer
                  description: Tần số lấy mẫu của MiniMax Speech 2.8 HD.
                sampleRate:
                  type: integer
                  description: Trường tương thích camelCase của `sample_rate`.
                speed:
                  type: number
                  description: Tốc độ nói, mặc định là 1.
                volume:
                  type: number
                  description: Âm lượng, mặc định là 1.
                pitch:
                  type: number
                  description: Cao độ, mặc định là 0.
                make_instrumental:
                  type: boolean
                  default: false
                  description: Có tạo chỉ phần nhạc đệm thuần túy hay không.
                light_music:
                  type: boolean
                  description: Có tạo theo hướng nhạc nhẹ/nhạc nền không.
                pure_music:
                  type: boolean
                  description: Có tạo theo hướng nhạc không lời không.
                custom_mode:
                  type: boolean
                  description: Có sử dụng chế độ tùy chỉnh hay không.
                customMode:
                  type: boolean
                  description: Trường tương thích camelCase của `custom_mode`.
                title:
                  type: string
                  description: Tiêu đề bài hát.
                tags:
                  type: string
                  description: Thẻ phong cách, ví dụ `electro pop, female vocal`.
                style:
                  type: string
                  description: Trường tương thích kiểu dáng.
                genre:
                  type: string
                  description: Trường tương thích phong cách âm nhạc.
                genres:
                  type: string
                  description: Trường tương thích phong cách âm nhạc.
                lyrics:
                  type: string
                  description: Nội dung lời bài hát.
                lyric:
                  type: string
                  description: '`lyrics` Tên bí danh tương thích.'
                custom_lyrics:
                  type: string
                  description: '`lyrics` Tên bí danh tương thích.'
                customLyrics:
                  type: string
                  description: '`lyrics` Tên bí danh tương thích.'
            examples:
              music_submit_prompt:
                summary: Tạo nhạc Suno v5.5
                value:
                  model: suno_music
                  upstream_model: suno-v5.5
                  prompt: >-
                    Imitating "Billie Jean," create a DJ song with the theme of
                    "the artificial intelligence revolution."
                  make_instrumental: false
              music_submit_lyria:
                summary: Tạo nhạc Lyria 3 Pro
                value:
                  model: suno_music
                  upstream_model: lyria-3-pro
                  prompt: Cinematic orchestral music with a hopeful finale.
              audio_submit_seed:
                summary: Tạo âm thanh Seed Audio 1.0
                value:
                  model: suno_music
                  upstream_model: seed-audio-1.0
                  prompt: 清晨海边的浪声与远处海鸥声。
              audio_submit_minimax_speech:
                summary: MiniMax Speech 2.8 HD
                value:
                  model: suno_music
                  upstream_model: minimax-speech-2.8-hd
                  prompt: 欢迎使用新版语音生成服务。
                  extraParams:
                    voice: moss_audio_ce44fc67-7ce3-11f0-8de5-96e35d26fb85
                    outputFormat: mp3
                    sampleRate: 32000
                    speed: 1
                    volume: 1
                    pitch: 0
              music_submit_light:
                summary: Tạo nhạc nhẹ
                value:
                  model: suno_music
                  upstream_model: minimax-music-v2.6
                  prompt: >-
                    Warm cafe background music with soft piano and strings,
                    relaxing and cinematic.
                  light_music: true
                  make_instrumental: true
              music_submit_lyrics:
                summary: Chế độ nâng cao lời bài hát
                value:
                  model: suno_music
                  upstream_model: mureka-v9
                  custom_mode: true
                  title: Summer Sea Breeze
                  tags: electro pop, female vocal, bright summer
                  lyrics: |-
                    [Verse]
                    Sea breeze moves across the white sand
                    [Chorus]
                    Turn the summer into a beam of light
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: success
                    description: Khi thành công là `success`.
                  message:
                    type: string
                    description: Thông báo lỗi hoặc thông báo nhắc.
                  data:
                    type: object
                    description: ID tác vụ, dùng cho truy vấn sau này.
              examples:
                music_submit_success:
                  summary: Gửi yêu cầu tạo nhạc thành công
                  value:
                    code: success
                    message: ''
                    data: task_xxx
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        Sử dụng xác thực Bearer Token.
        Định dạng: `Authorization: Bearer sk-xxxxxx`

````