# Treblo

> Generate songs, check generation progress and retrieve finished audio.

App · 7 actions. Web page: https://docs.lodol.com/docs/integrations/treblo

## Actions

### Extend a song

Continue a song from the end of its source audio.

**Inputs**

- Audio URL (`audio_url`, text): Public URL of the audio or a finished Treblo song.
- Audio upload ID (`audio_upload_id`, text): ID returned by Upload an audio file.
- Prompt (`prompt`, text): Describe the music you want.
- Instrumental (`instrumental`, true/false): Generate music without vocals.
- Crop duration (`crop_duration`, number): Seconds to remove from the end before continuing. At least 0.
- Context seconds (`context_seconds`, number): Seconds of the source ending to listen to. From 0.01 to 284.

**Outputs**

- `data` (object): The response from Treblo.

**Example output**

```json
{
  "data": {
    "task_id": "example"
  }
}
```

### Generate a song

Start a song from a prompt and return the task ID. Each successful song uses credits.

**Inputs**

- Prompt (`prompt`, text, required): Describe the music you want.
- Instrumental (`instrumental`, true/false): Generate music without vocals.
- Enable streaming (`enable_streaming`, true/false): Make audio available for early streaming.
- Idempotency key (`idempotency_key`, text): Reuse this value when retrying the same generation.

**Outputs**

- `data` (object): The response from Treblo.

**Example output**

```json
{
  "data": {
    "task_id": "example"
  }
}
```

### Generate from reference audio

Start a cover, match the source style, or use a voice recording as the reference.

**Inputs**

- Audio URL (`audio_url`, text): Public URL of the audio or a finished Treblo song.
- Audio upload ID (`audio_upload_id`, text): ID returned by Upload an audio file.
- Reference mode (`reference_mode`, text, required): Which part of the source to preserve. One of: `cover`, `style`, `voice`.
- Prompt (`prompt`, text): Describe the music you want.
- Instrumental (`instrumental`, true/false): Generate music without vocals.
- Reference scale (`reference_scale`, number): How closely to follow the reference. Voice mode supports up to 7. From 1 to 7.

**Outputs**

- `data` (object): The response from Treblo.

**Example output**

```json
{
  "data": {
    "task_id": "example"
  }
}
```

### Get a song generation

Read generation details and the audio URLs when the song is finished.

**Inputs**

- Task ID (`task_id`, text, required): Task id.

**Outputs**

- `data` (object): The response from Treblo.

**Example output**

```json
{
  "data": {
    "error_message": "example",
    "song_paths": [
      "example"
    ],
    "status": "example",
    "task_id": "example"
  }
}
```

### Get credit balance

Check how many credits are available to generate songs.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Treblo.

**Example output**

```json
{
  "data": {}
}
```

### Get generation status

Read the current status of a song generation.

**Inputs**

- Task ID (`task_id`, text, required): Task id.

**Outputs**

- `data` (object): The response from Treblo.

**Example output**

```json
{
  "data": {
    "status": "example",
    "task_id": "example"
  }
}
```

### Upload an audio file

Upload source audio for a song edit. The upload ID lasts about a day.

**Inputs**

- File (`file`, text, required): Audio recording to upload.

**Outputs**

- `data` (object): The response from Treblo.

**Example output**

```json
{
  "data": {
    "audio_upload_id": "example"
  }
}
```
