下载音频
- 把已有 clip 转成 mp3 或 wav 文件,异步提交任务
- 用
clip_id引用源音频 - 结果含实际格式与文件大小
认证
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请求参数
模型名,固定传 flowmusic,不区分大小写。
待下载的音乐 clip 标识,取自成功任务的 result.music[].clip_id。
下载格式,只能是这两个值之一:
mp3有损,体积小wav无损,适合后期
没有默认值,必须显式传。
The model name, always flowmusic, case-insensitive.
The music clip identifier to download, taken from result.music[].clip_id of a successful task.
The download format; only one of these two:
mp3lossy, smallerwavlossless, suited to post-processing
There's no default; it must be passed explicitly.
mp3 还是 wav
| 格式 | 体积 | 适合 |
|---|---|---|
| mp3 | 小,约为 wav 的十分之一 | 分发、试听、网络传输 |
| wav | 大 | 后期混音、母带处理、再编辑 |
要拿去继续加工就选 wav。只是给人听就选 mp3,能省下大量存储与带宽。
format 是必填项,没有默认值。不传会直接报错,不会默默给你 mp3。
| Format | Size | Best for |
|---|---|---|
| mp3 | Small, about one tenth of wav | Distribution, previewing, network transfer |
| wav | Large | Post mixing, mastering, further editing |
Choose wav if the file will be processed further. Choose mp3 if it's only for listening, saving a lot of storage and bandwidth.
format is required and has no default. Omitting it errors out; it won't quietly give you mp3.
提交响应
状态码,成功为 200。
任务状态,刚提交时为 submitted。
任务唯一标识,用于查询进度与结果。
The status code; 200 on success.
The task status; submitted right after submission.
The unique task identifier, used to query progress and results.
任务结果
用 GET /v1/music/tasks/{task_id} 查询。
任务 ID。
如 completed。
进度百分比。
创建时间戳。
完成时间戳。
耗时,单位秒。
费用。
积分消耗。
片段标识。
实际格式。可能与请求的不同时出现转换失败后的回退。
MIME 类型,如 audio/mpeg、audio/wav。
文件大小,单位字节。
音频地址,与 url 同值。
与 audio_url 同值。
format 字段返回的是实际格式,可能与请求的值不一致。写代码时以返回值为准,不要假设计划要什么就拿什么。
Query with GET /v1/music/tasks/{task_id}.
The task ID.
Such as completed.
Progress percentage.
Creation timestamp.
Completion timestamp.
Duration in seconds.
Cost.
Credits consumed.
The clip identifier.
The actual format. It may differ from the request when a failed conversion falls back.
The MIME type, e.g. audio/mpeg or audio/wav.
File size in bytes.
The audio URL; the same value as url.
The same value as audio_url.
The format field reports the actual format, which may not match what you requested. Code against the returned value rather than assuming you get what you asked for.
一次性拿两种格式
本接口一次只转一种格式。需要 mp3 与 wav 各一份,就得提交两次任务,各计一次费。
如果只是存档,建议直接要 wav,之后自己转 mp3,比重复调用便宜。
This endpoint converts one format per call. To get both mp3 and wav, submit two tasks and pay twice.
For archiving, request wav and convert to mp3 yourself afterward — cheaper than calling twice.
错误码
For error response formats, 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.