GET
/
songs
JavaScript
import Weights from '@weights-ai/sdk';

const client = new Weights({
  bearerToken: 'My Bearer Token',
});

const songs = await client.songs.list();

console.log(songs.songs);
{
  "songs": [
    {
      "id": "cmcz89fci00zr0dlt68klunpf",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:35:00Z",
      "startTime": "2024-01-15T10:31:00Z",
      "endTime": "2024-01-15T10:34:00Z",
      "status": "SUCCEEDED",
      "attempt": 1,
      "outputUrl": "https://tracks.weights.com/songs/song_123456789.mp3",
      "lyrics": "In the moonlight, we dance through the night",
      "prompt": "blues, melancholic, raw, lonely bar, heartbreak",
      "queuePosition": 5
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

limit
number
default:25

Number of items to return per page

Required range: 1 <= x <= 50
Examples:

25

cursor
string | null

Cursor for pagination to get the next page of results - this is the last item's ID from the previous page

Examples:

"cmcz89fci00zr0dlt68klunpf"

Response

200
application/json

Returns a paginated list of all songs generated by the authenticated user.

The response is of type object.