## Create a Task

Build a complete karaoke package in one API call — an instrumental backing track, a vocal reference, and time-synced lyrics. All three models run in parallel from a single Task.

### API Code Examples

#### Python

```python
import requests

API_KEY = "your_api_key"
HEADERS = {"Content-Type": "application/json", "x-api-key": API_KEY}

response = requests.post(
    "https://api.audioshake.ai/tasks",
    headers=HEADERS,
    json={
        "assetId": "your_asset_id",
        "targets": [
            {"model": "instrumental", "formats": ["wav"]},
            {"model": "vocals", "formats": ["wav"]},
            {"model": "alignment", "formats": ["json"]}
        ]
    }
)

task_id = response.json()["id"]
print(f"Task created: {task_id}")
```

#### JavaScript

```javascript
const API_KEY = "your_api_key";
const headers = { "Content-Type": "application/json", "x-api-key": API_KEY };

const createRes = await fetch("https://api.audioshake.ai/tasks", {
  method: "POST",
  headers,
  body: JSON.stringify({
    assetId: "your_asset_id",
    targets: [
      { model: "instrumental", formats: ["wav"] },
      { model: "vocals", formats: ["wav"] },
      { model: "alignment", formats: ["json"] }
    ]
  })
});

const { id: taskId } = await createRes.json();
console.log(`Task created: ${taskId}`);
```

#### cURL

```bash
curl -X POST "https://api.audioshake.ai/tasks" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $AUDIOSHAKE_API_KEY" \
  -d '{
    "assetId": "your_asset_id",
    "targets": [
      { "model": "instrumental", "formats": ["wav"] },
      { "model": "vocals", "formats": ["wav"] },
      { "model": "alignment", "formats": ["json"] }
    ]
  }'
```

### Outputs

| Target       | Role                                          |
|--------------|-----------------------------------------------|
| `instrumental` | Backing track for playback                    |
| `vocals`       | Reference track for QA and timing             |
| `alignment` (JSON) | Word-level timed text for on-screen lyrics |

### Use cases

- Power karaoke apps with synced lyrics and backing tracks
- Publish sing-along experiences on streaming platforms
- Batch-process entire song catalogs for karaoke libraries

[**Stem Separation**](https://developer.audioshake.ai/separate-stems)  
Extract additional individual instruments beyond vocals.

[**Lyric Transcription**](https://developer.audioshake.ai/transcribe-lyrics)  
Learn more about the transcription model and output format.
