BPM 分析
- 分析歌曲的速度,异步任务
- 引用源音轨用
task_id加audio_index - 只返回分析结果,不产出音频
认证
All endpoints authenticate with a Bearer token.
Get an API key: open the console and create one.
Add it to the request header:
Authorization: Bearer YOUR_OAIRoute_KEY请求参数
音频模型,默认 suno。
产出源音轨那次任务的 task_id。缺失或无法解析源音轨时,提交阶段直接返回 400。
引用源任务结果 data.result.music[] 中的第几首,默认 1,从 1 开始。
一次生成通常 2 首,即索引 1 和 2。
本端点没有版本维度,不要传 version。传了会被丢弃,也不影响计费。
引用源音轨只需 task_id 与 audio_index 两个值,无需记录任何额外 id。
The audio model; defaults to suno.
The task_id of the task that produced the source track. When it's missing or the source can't be resolved, submission returns a 400.
Which track in the source task's data.result.music[], default 1, starting at 1.
A single generation usually has 2, at indexes 1 and 2.
This endpoint has no version dimension; don't pass version. If passed it's discarded and doesn't affect billing.
Referencing the source track needs only task_id and audio_index; no extra ids to keep track of.
响应
响应状态码。
任务状态,提交后为 submitted。
任务唯一标识,用于轮询 GET /v1/music/tasks/{task_id}。
The response status code.
The task status; submitted after submission.
The unique task identifier, used to poll GET /v1/music/tasks/{task_id}.
BPM 有什么用
| 用途 | 说明 |
|---|---|
| 配乐选曲 | 按目标节奏筛选,短视频常用 100 到 130 |
| 剪辑对齐 | 按 BPM 算一拍时长,让画面切点踩在节拍上 |
| 二次创作 | 混搭或续写时保持节奏一致 |
| 曲库检索 | 按速度区间分类管理素材 |
算一拍时长:60 / BPM 秒。120 BPM 就是一拍 0.5 秒,四拍一小节 2 秒。
| Use | Notes |
|---|---|
| Choosing soundtrack | Filter by target tempo; short videos commonly use 100 to 130 |
| Edit alignment | Compute the beat length from BPM so cuts land on the beat |
| Remixing | Keep tempo consistent when mashing up or continuing |
| Library search | Classify assets by tempo range |
Beat length is 60 / BPM seconds. At 120 BPM one beat is 0.5 seconds, and a four-beat bar is 2 seconds.
错误码
| HTTP | type | 说明 |
|---|---|---|
| 400 | invalid_request_error | 请求参数无效 |
| 401 | authentication_error | 身份验证失败,请检查API密钥 |
| 402 | payment_required | 账户余额不足 |
| 429 | rate_limit_error | 请求过于频繁 |
| HTTP | type | Notes |
|---|---|---|
| 400 | invalid_request_error | Invalid request parameters |
| 401 | authentication_error | Authentication failed; check the API key |
| 402 | payment_required | Insufficient account balance |
| 429 | rate_limit_error | Too many requests |
For more status codes and retry guidance see Error codes and rate limits; for troubleshooting steps on common errors see the FAQ.
使用示例
提交一个任务并拿到 task_id:
提交成功只表示任务已受理。真正的产物要拿返回的 task_id 去任务查询接口轮询,status 变成 completed 之后才有结果。
Submit a task and get a task_id:
A successful submission only means the task was accepted. To get the actual output, poll the task query endpoint with the returned task_id; results appear only after status becomes completed.