---
title: "base64 で渡された音（BGM・効果音）を素材に登録する"
method: POST
path: "/api/v1/assets/audio-uploads/inline"
tags: ["assets"]
---

# base64 で渡された音（BGM・効果音）を素材に登録する

`POST /api/v1/assets/audio-uploads/inline`

## Request

- Base URL: `https://app.yukkurigen.com`
- URL: `https://app.yukkurigen.com/api/v1/assets/audio-uploads/inline`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

## Request body

- object
  - `dataBase64` string, required: 音のファイルの中身の base64（data:audio/mpeg;base64, の前置きは有っても無くてもよい）
  - `kind` 'bgm' | 'sfx', required: bgm（行の bgm に書く曲）/ sfx（行の effect に書く効果音）
  - `fileName` string
  - `mimeType` 'audio/mpeg' | 'audio/wav' | 'audio/ogg': 省略可。書くなら中身と一致させる

## Response `200`

登録した

- RegisteredAudio: audio-uploads/confirm と audio-uploads/inline の 200。url を行の bgm / effect にそのまま書ける
  - `data` object
    - `ok` boolean
    - `url` string: 行の bgm / effect にそのまま書ける永続 URL
    - `assetId` string
    - `key` string
    - `kind` 'bgm' | 'sfx'
    - `mimeType` 'audio/mpeg' | 'audio/wav' | 'audio/ogg': 中身から判定した形式
    - `fileSizeBytes` integer
    - `alreadyRegistered` boolean: 確定済みの key をもう一度確定した（使用量は増えていない）

## Other responses

- `400`: base64 として読めない・中身が mp3 / wav / ogg でない・大きすぎる・mimeType と中身が違う（code: validation_error）
- `401`: 認証エラー（code: unauthenticated）
- `403`: スコープ不足（code: insufficient_scope。projects:write が必要）
- `429`: レート上限（code: rate_limited）またはストレージ容量の上限（code: quota_exceeded）
- `500`: 保存・登録に失敗した（code: internal_error）

## Changes

- **2026-10-20** `ba5f36b016da`: 25 warning, 15 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 `403`
  - added the new `already_subscribed` enum value to the `code` response property for the response status `429`
  - …36 more

[Operation history](https://skmtc.dev/yukkurigen/apis/yukkurigen-ai-operated-api/changes/api/v1/assets/audio-uploads/inline/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)
