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

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

const song = await client.songs.create({
  lyrics: 'In the moonlight, we dance through the night',
  prompt: 'blues, melancholic, raw, lonely bar, heartbreak',
});

console.log(song.id);
{
  "id": "<string>"
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Response

200
application/json

Returns the ID of the created song generation job.

The response is of type object.