# MIDI Download

**What**：Download instrument MIDI (requires a clipId from "Get Instrument Stems" / gen_stem_all first).

**When**：Use to bring the AI arrangement into a DAW for melody editing / re-arranging. ⚠ The clipId must be a gen_stem_all result on YOUR account, or you get same_account_required.

## Endpoints
- POST `/api/cqt/generator/suno` (task: `mdi`)
- GET `/api/cqt/info/suno?id={taskId}`

## Request params
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| task | string | Yes | Fixed value: mdi |
| clipId | string | Yes | Must be a clipId returned by gen_stem_all on your own account |

## Request example
```bash
curl -X POST https://api.novapi.ai/api/cqt/generator/suno \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{ "task":"mdi", "clipId":"clip_stem_xyz" }'
# -> { "code":200, "data":"<taskId>" }
```

## Response example
```json
{
  "code": 500,
  "msg": "same_account_required",
  "data": {
    "id": "f28f534a07994c199e5b0cee8e74dcbe",
    "taskType": "mdi",
    "status": "failed",
    "errorMsg": "same_account_required",
    "param": {
      "task": "mdi",
      "clipId": "217c547a-3aee-48db-9490-e4182566fe91"
    },
    "result": "任务失败",
    "createTime": "2026-07-09 14:13:36",
    "completeTime": "2026-07-09 14:13:45"
  }
}
```

## Response fields
| Field | Type | Description |
| --- | --- | --- |
| code | number | Status code; 200 = success, non-200 on failure (e.g. 500) |
| msg | string | Top-level message; equals errorMsg on failure |
| data.id | string | Task ID |
| data.taskType | string | Task type; always "mdi" |
| data.status | string | Status: succeeded / failed |
| data.errorMsg | string | Failure reason. same_account_required = clipId is not a gen_stem_all result on your account |
| data.param | object | Echo of the request params you submitted |
| data.result | string \| object | On failure the string "任务失败"; on success the MIDI result (success sample TBD) |
| data.createTime / completeTime | string | Task submit time / completion time |

## OpenAI-style call
This task is also available via `POST /v1/audio/generations` (add `task: "mdi"` to the body, write model as suno-v6); poll `GET /v1/audio/generations/{id}`, non-audio results are in `result`.

```bash
curl -X POST https://api.novapi.ai/v1/audio/generations \
  -H 'Authorization: Bearer <API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "suno",
  "task": "mdi",
  "clipId": "clip_stem_xyz"
}'
# -> { "id":"audio_<taskId>", "object":"audio.generation", "status":"queued", ... }
# poll: GET https://api.novapi.ai/v1/audio/generations/audio_<taskId>
```
