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-Key | string | Yes | Your API key |
| Parameter | Type | Description |
|---|
id | string | 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,
"createdAt": "2025-01-15 10:30:00",
"completedAt": "2025-01-15T10:30:17.623Z"
}
}
| Field | Type | Description |
|---|
data.id | string | Unique generation ID |
data.title | string | Generation title |
data.prompt | string | The tags/prompt used |
data.status | string | pending, processing, completed, failed |
data.audioUrl | string | null | Audio download URL (available when completed) |
data.duration | number | Track duration in seconds |
data.fileSize | number | null | Audio file size in bytes |
data.isPublic | boolean | Whether the generation is publicly visible |
data.playCount | number | Number of plays |
data.downloadCount | number | Number of downloads |
data.likeCount | number | Number of likes |
data.parameters | object | Generation parameters (bpm, duration, keyscale, timesignature, seed) |
data.errorMessage | string | null | Error details if generation failed |
data.generationTime | number | null | Time taken to generate in seconds |
data.createdAt | string | Creation timestamp |
data.completedAt | string | null | Completion timestamp (ISO 8601) |
| Status | Description |
|---|
pending | Generation is queued |
processing | Generation is in progress |
completed | Generation finished — audioUrl is available |
failed | Generation failed — check errorMessage field for details |
Since generation is asynchronous, poll this endpoint to check when your track is ready:
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_KEY | 401 | X-API-Key header was not provided |
INVALID_API_KEY | 401 | API key is malformed, revoked, or does not exist |
NOT_FOUND | 404 | Resource not found |
INTERNAL_ERROR | 500 | Unexpected server error |