GET /v1/generations/:id Get details for a specific generation
Retrieve the full details of a specific music generation, including its current status and download URL.
GET https://pub.finetuning.ai/v1/generations/:id
Header Type Required Description X-API-Keystring Yes Your API key
Parameter Type Description idstring The generation ID (e.g., gen_abc123)
curl https://pub.finetuning.ai/v1/generations/gen_abc123 \
-H "X-API-Key: ft_live_your_key_here"
{
"data" : {
"id" : "gen_abc123" ,
"title" : "modern country instrumental" ,
"prompt" : "modern country instrumental, acoustic guitar strumming, pedal steel guitar, fiddle melody" ,
"status" : "completed" ,
"audioUrl" : "https://media.finetuning.ai/audio/gen_abc123.mp3" ,
"duration" : 120 ,
"fileSize" : null ,
"isPublic" : false ,
"playCount" : 0 ,
"downloadCount" : 0 ,
"likeCount" : 0 ,
"parameters" : {
"bpm" : 110 ,
"duration" : 120 ,
"keyscale" : "G major" ,
"timesignature" : 4 ,
"seed" : 1951074202
},
"errorMessage" : null ,
"generationTime" : 17 ,
"webhook" : null ,
"createdAt" : "2025-01-15 10:30:00" ,
"completedAt" : "2025-01-15T10:30:17.623Z"
}
}
Field Type Description data.idstring Unique generation ID data.titlestring Generation title data.promptstring The tags/prompt used data.statusstring pending, processing, completed, faileddata.audioUrlstring | null Audio download URL (available when completed) data.durationnumber Track duration in seconds data.fileSizenumber | null Audio file size in bytes data.isPublicboolean Whether the generation is publicly visible data.playCountnumber Number of plays data.downloadCountnumber Number of downloads data.likeCountnumber Number of likes data.parametersobject Generation parameters (bpm, duration, keyscale, timesignature, seed) data.errorMessagestring | null Error details if generation failed data.generationTimenumber | null Time taken to generate in seconds data.webhookstring | null Webhook URL set at create time, or null if none was provided data.createdAtstring Creation timestamp data.completedAtstring | null Completion timestamp (ISO 8601)
Status Description pendingGeneration is queued processingGeneration is in progress completedGeneration finished — audioUrl is available failedGeneration failed — check errorMessage field for details
Since generation is asynchronous, poll this endpoint to check when your track is ready. If you'd rather not poll, set a webhook URL when you create the generation and we'll deliver the result to you — see Webhooks .
async function waitForGeneration ( id , apiKey ) {
while ( true ) {
const res = await fetch ( `https://pub.finetuning.ai/v1/generations/${ id }` , {
headers: { 'X-API-Key' : apiKey },
});
const { data } = await res. json ();
if (data.status === 'completed' ) return data;
if (data.status === 'failed' ) throw new Error (data.errorMessage);
// Wait 2 seconds before polling again
await new Promise ( r => setTimeout (r, 2000 ));
}
}
Code Status Description MISSING_API_KEY401 X-API-Key header was not provided INVALID_API_KEY401 API key is malformed, revoked, or does not exist NOT_FOUND404 Resource not found INTERNAL_ERROR500 Unexpected server error