---
title: "ACE-Step で BGM を1曲作り、自分の BGM 素材として登録する（非同期）"
method: POST
path: "/api/v1/assets/bgm/generate"
tags: ["assets"]
---

# ACE-Step で BGM を1曲作り、自分の BGM 素材として登録する（非同期）

`POST /api/v1/assets/bgm/generate`

## Request

- Base URL: `https://app.yukkurigen.com`
- URL: `https://app.yukkurigen.com/api/v1/assets/bgm/generate`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

## Headers

- `Prefer` 'respond-async'

## Request body

- object
  - `tags` string, required: 曲の雰囲気（英語のスタイルタグ。例: "8-bit chiptune, energetic, fast tempo"）
  - `duration` integer: 曲の長さ（秒）
  - `name` string: 素材の名前（省略するとタグから決める）
  - `projectId` string: 関係するプロジェクト（所有を確かめる）。bgm_path は変えない
  - `applyToProject` boolean: true で作った曲を projectId の bgm_path にする（projectId が要る）

## Response `202`

受け付けた（Preference-Applied: respond-async）

- object
  - `jobId` string, required
  - `status` string
  - `pollUrl` string, required: /api/v1/jobs/{jobId}

## Other responses

- `400`: 入力が不正（code: validation_error。applyToProject に projectId が無いときも）
- `401`: 認証エラー（code: unauthenticated）
- `402`: クレジット不足（code: insufficient_credits）か、API キーで有料プラン・API 連携ライセンスが無い（code: plan_required。purchase つき）
- `403`: スコープ不足（code: insufficient_scope。projects:write が必要）・他人のプロジェクト（code: forbidden）・決済の確認中
- `404`: projectId のプロジェクトが無い（code: not_found）
- `429`: レート上限（code: rate_limited）
- `500`: 受け付けに失敗した（code: internal_error）
- `503`: 非同期ジョブが無効な環境（code: jobs_unavailable）・ジョブを作れなかった（code: unavailable）

## Changes

- **2026-10-20** `ba5f36b016da`: 40 warning, 24 info
  - added the new `already_subscribed` enum value to the `code` response property for the response status `400`
  - added the new `already_subscribed` enum value to the `code` response property for the response status `401`
  - added the new `already_subscribed` enum value to the `code` response property for the response status `402`
  - added the new `already_subscribed` enum value to the `code` response property for the response status `403`
  - …60 more

[Operation history](https://skmtc.dev/yukkurigen/apis/yukkurigen-ai-operated-api/changes/api/v1/assets/bgm/generate/post.md)

---

[API](https://skmtc.dev/yukkurigen/apis/yukkurigen-ai-operated-api.md) · [All operations](https://skmtc.dev/yukkurigen/apis/yukkurigen-ai-operated-api/llms.txt) · [OpenAPI document](https://skmtc.dev/yukkurigen/apis/yukkurigen-ai-operated-api/revisions/ba5f36b016da?raw)
