> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Hämta musikfinjusteringar

GET https://api.elevenlabs.io/v1/music/finetunes

Lista musik-Finetune-modeller som du har åtkomst till (dina egna, delade i arbetsytan och kuraterade av ElevenLabs), med valfri filtrering, sortering och markörpaginering.

Reference: https://elevenlabs.io/docs/api-reference/music/finetunes/list

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Query parameters

- `cursor` (string, optional, nullable) — Används för att hämta nästa sida. Markören returneras i svaret.
- `page_size` (integer, optional, default: 50) — Hur många Finetune-modeller som ska returneras. Max är 150, standardvärdet är 50.
- `visibility` (enum, optional, nullable) — Filtrera efter synlighet. 'private' returnerar privata finetunes, 'workspace' returnerar finetunes som delas i arbetsytan och 'public' returnerar offentliga finetunes, som för närvarande är sammanställda av ElevenLabs. Utelämna för att returnera alla tillgängliga finetunes.
  - Allowed values: `private`, `workspace`, `public`
- `created_by` (enum, optional, nullable) — Filtrera efter skapare. 'self' returnerar finetunes som du har skapat, 'workspace' returnerar finetunes som skapats av teammedlemmar i arbetsytan och 'elevenlabs' returnerar finetunes som har sammanställts av ElevenLabs. Utelämna för att returnera finetunes från alla skapare.
  - Allowed values: `self`, `workspace`, `elevenlabs`
- `sort` (enum, optional, default: created_at) — Sortera efter fält (created_at eller name)
  - Allowed values: `created_at`, `name`
- `sort_direction` (enum, optional, default: desc) — Sorteringsriktning (asc eller desc)
  - Allowed values: `asc`, `desc`

## Response

### 200

Lyckat svar

- `finetunes` (list of MusicFinetuneResponseModel, required) — Finetune-modellerna på denna sida.
- `next_cursor` (string, required, nullable) — Markör att skicka som `cursor` för att hämta nästa sida; `null` när det inte finns fler resultat.
- `has_more` (boolean, required) — Om fler finjusteringar finns efter den här sidan.

## Errors

### 422 Unprocessable Entity Error

Valideringsfel

- `detail` (list of ValidationError, optional)

## Types

### MusicFinetuneResponseModel

- `id` (string, required) — Unik identifierare för finjusteringen.
- `name` (string, required) — Namn på finjusteringen.
- `tags` (list of string, required) — Taggar som är kopplade till finetune-modellen.
- `model_id` (string, required) — Musikbasmodellen som finetune-modellen tränades på.
- `created_at` (string, required) — När finjusteringen skapades (UTC).
- `visibility` (enum, required) — Vem som kan komma åt denna Finetune: `private` (endast du), `workspace` (medlemmar i din arbetsyta), `public` (kurerad av ElevenLabs och tillgänglig för alla).
  - Allowed values: `private`, `workspace`, `public`
- `created_by` (enum, required) — Vem som skapade Finetune: `self`, `workspace` eller `elevenlabs`.
  - Allowed values: `self`, `workspace`, `elevenlabs`
- `status` (enum, required) — Livscykelstatus för träning: pending, in_progress, completed, failed och blocked.
  - Allowed values: `pending`, `in_progress`, `completed`, `failed`, `blocked`
- `training_progress` (double, required) — Träningsförlopp från 0.0 till 1.0.
- `primary_genre` (string, optional, nullable) — Primär musikgenre för Finetune.
- `failure_reason` (enum, optional, nullable) — Orsak till att Finetune misslyckades eller blockerades, om tillämpligt.
  - Allowed values: `audio_processing_failed`, `copyright_violation`, `training_failed`

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "finetunes": [
    {
      "id": "string",
      "name": "string",
      "tags": [
        "string"
      ],
      "model_id": "music_v1",
      "created_at": "2024-01-15T09:30:00Z",
      "visibility": "private",
      "created_by": "self",
      "status": "pending",
      "training_progress": 1.1,
      "primary_genre": "string",
      "failure_reason": "audio_processing_failed"
    }
  ],
  "next_cursor": "string",
  "has_more": true
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/music/finetunes"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/music/finetunes';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/music/finetunes"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/music/finetunes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.elevenlabs.io/v1/music/finetunes")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/music/finetunes');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/music/finetunes");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/music/finetunes")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```