# Get Music Generation

Source: https://recoupable.dev/docs/api-reference/music/get

Get music generation

## GET /api/music/{generationId}

Full OpenAPI specification: https://recoupable.dev/docs/spec/content.json

## Authentication

This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification.

[Authentication guide](https://recoupable.dev/docs/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Recoup API - Content",
    "description": "API documentation for the Recoup platform - an AI agent platform for the music industry",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.recoupable.dev"
    }
  ],
  "paths": {
    "/api/music/{generationId}": {
      "get": {
        "summary": "Get music generation",
        "description": "One generation, including the `seed` the model used and its `logs` progress, both read live from the provider rather than stored. This is the polling target while a generation is in flight: call it until `status` is `completed` or `failed`. Responses are never cached.",
        "security": [
          {
            "apiKeyAuth": []
          },
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "generationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The generation's id, from [Generate Music](/api-reference/music/generate)."
          },
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Optional. Read on behalf of another account you can access."
          }
        ],
        "responses": {
          "200": {
            "description": "The generation, with the seed it used and its render progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicGenerationDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "`generationId` is not a valid uuid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicGenerationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicGenerationErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Access denied to this generation's account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicGenerationErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No generation with that id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicGenerationErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MusicGenerationErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "MusicGenerationDetailResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "success"
            ],
            "description": "Status of the request"
          },
          "generation": {
            "$ref": "#/components/schemas/MusicGenerationDetail"
          }
        }
      },
      "MusicGenerationErrorResponse": {
        "type": "object",
        "required": [
          "status",
          "error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "error"
            ],
            "description": "Always `error`"
          },
          "missing_fields": {
            "type": "array",
            "description": "JSON path segments to the first field that failed validation, e.g. `[\"lyrics\"]`",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            }
          },
          "error": {
            "type": "string",
            "description": "Human-readable error message"
          }
        }
      },
      "MusicGenerationDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/MusicGeneration"
          },
          {
            "type": "object",
            "properties": {
              "seed": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The seed the model actually used, read live from the provider rather than stored. Null until the generation completes, and null if the provider cannot be reached. Pass it back as `seed` to reproduce a generation. It is the only generation parameter recoverable after the fact: `num_inference_steps` and `guidance_scale` are consumed when the request is submitted and are never reported back."
              },
              "logs": {
                "type": "array",
                "description": "The model's own render progress, oldest first, read live from the provider rather than stored. Empty if the provider cannot be reached. Returned only on the single-generation read.",
                "items": {
                  "$ref": "#/components/schemas/MusicGenerationLogEntry"
                }
              }
            }
          }
        ]
      },
      "MusicGeneration": {
        "type": "object",
        "description": "One music generation.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The generation's id. Poll [Get Music Generation](/api-reference/music/get) with this."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ],
            "description": "Lifecycle phase. `pending` until the workflow picks it up, `processing` while fal is rendering, then `completed` or `failed`."
          },
          "prompt": {
            "type": "string",
            "description": "The music description the song was generated from."
          },
          "lyrics": {
            "type": "string",
            "description": "The lyrics the song was generated from."
          },
          "model": {
            "type": "string",
            "description": "The generating model.",
            "example": "minimax/music-3"
          },
          "duration_seconds": {
            "type": [
              "number",
              "null"
            ],
            "description": "Actual length of the generated audio. Null until completed; may be shorter than requested."
          },
          "audio_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Playable audio URL. Null until the generation completes."
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the generation failed. Null unless `status` is `failed`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the generation was created."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the generation last changed."
          }
        }
      },
      "MusicGenerationLogEntry": {
        "type": "object",
        "description": "One line of the model's render progress.",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time",
            "description": "When the line was emitted."
          },
          "message": {
            "type": "string",
            "description": "What the model reported.",
            "example": "20/180"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your Recoup API key. [Learn more](/quickstart#api-keys)."
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
```
