Bỏ qua đến nội dung

music generator

Tích hợp

Id mô hình cassetteai/music-generator
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/cassetteai/music-generator?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "duration": 50,
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Các tệp như ví dụ: 0,02 $ 20 tín dụng API tệp của bạn được đo trước khi chạy Chạy trên trang này

Lấy khóa API
CassetteAI Văn bản sang nhạc 10–180 s #music#cassetteai

Chuyển văn bản thành âm nhạc, tạo một bản nhạc dài 10 đến 180 giây từ lời nhắc

CassetteAI · Âm thanh

Kết quả đầu tiên của bạn sẽ xuất hiện ở đây

Tạo một yêu cầu bên dưới và chạy bằng khóa API của bạn. Đầu ra được sao chép vào bộ lưu trữ của chúng tôi, giữ vĩnh viễn hoặc 7 ngày miễn phí.

Tạo một yêu cầu

Các điều khiển được tạo từ lược đồ mô hình. Mã và giá sẽ cập nhật khi bạn thay đổi chúng.

•bắt buộc

Lời nhắc mô tả nhạc cần tạo.

•bắt buộc

Thời lượng nhạc đầu ra, tính bằng giây.

POST /run/cassetteai/music-generator?wait=20 báo giá → 0,02 $
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/cassetteai/music-generator?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "duration": 50,
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Chạy yêu cầu này

Key của bạn vẫn nằm trong trình duyệt này: key chỉ được gửi đến Doitong API và chỉ được lưu trong localStorage nếu bạn chọn Ghi nhớ. Nhận khóa API

Giới thiệu về music generator

Sáng tác nhạc từ mô tả văn bản. Cả hai đầu vào đều bắt buộc: `prompt` mô tả âm nhạc và số nguyên `duration` từ 10 đến 180 giây. Trả về một tệp âm thanh. Phù hợp để tạo nhanh nhạc nền và bản phác thảo có độ dài xác định.

Tham số

TênKiểu Mặc địnhĐược phép Mô tả
durationbắt buộc
Kiểuinteger
10 – 180
Thời lượng nhạc đầu ra, tính bằng giây.
promptbắt buộc
Kiểustring
Lời nhắc mô tả nhạc cần tạo.
bắt buộc

Đầu ra

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "cassetteai/music-generator",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 20,
    "usd": "0.02",
    "charged": 20,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "duration": 50
  },
  "output": {
    "audio_file": {
      "content_type": "audio/mpeg",
      "file_data": "string",
      "file_name": "0-output.mp3",
      "file_size": 1843200,
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3"
    }
  },
  "outputs": [
    {
      "type": "audio",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_size": 1843200,
      "duration": 12,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Tệp của bạn, lựa chọn của bạnMỗi outputs[].url là một bản sao trên bộ lưu trữ của chúng tôi: được giữ vĩnh viễn (tính phí theo GB-tháng) hoặc 7 ngày miễn phí, theo cài đặt tài khoản hoặc ?storage=.
Cùng một cấu trúc trên mọi mô hìnhtype, url, content_type, width, height và duration cho hình ảnh, video và âm thanh. output là đối tượng kết quả riêng của mô hình.
Các trường đầu ra
audio_file
object {content_type, file_data, file_name, file_size, url}Nhạc do mô hình tạo ra.

Thêm mô hình: Văn bản sang nhạc

Dành cho tác nhân AI: trang này ở dạng Markdown tại https://doitong.com/vi/developers/models/cassetteai/music-generator.md. Tất cả mô hình và hướng dẫn: https://doitong.com/developers/llms.txt