Skip to main content
GET
/
api
/
v1
/
generate
/
record-info
Get Music Generation Details
curl --request GET \
  --url https://api.sunoapi.org/api/v1/generate/record-info \
  --header 'Authorization: Bearer <token>'
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "5c79****be8e",
    "parentMusicId": "",
    "param": "{\"prompt\":\"A calm piano track\",\"style\":\"Classical\",\"title\":\"Peaceful Piano\",\"customMode\":true,\"instrumental\":true,\"model\":\"V3_5\"}",
    "response": {
      "taskId": "5c79****be8e",
      "sunoData": [
        {
          "id": "8551****662c",
          "audioUrl": "https://example.cn/****.mp3",
          "streamAudioUrl": "https://example.cn/****",
          "imageUrl": "https://example.cn/****.jpeg",
          "prompt": "[Verse] 夜晚城市 灯火辉煌",
          "modelName": "chirp-v3-5",
          "title": "钢铁侠",
          "tags": "electrifying, rock",
          "createTime": "2025-01-01 00:00:00",
          "duration": 198.44
        }
      ]
    },
    "status": "SUCCESS",
    "type": "GENERATE",
    "errorCode": null,
    "errorMessage": null
  }
}
Retrieve detailed information about a music generation task, including status, parameters, and results. This endpoint is essential for tracking the progress of your music generation requests and retrieving the final results.

Task Status Tracking

Monitor your generation tasks through different stages:

Status Values

  • PENDING: Task is queued and waiting to start
  • TEXT_SUCCESS: Lyrics/text generation completed
  • FIRST_SUCCESS: First audio track generated
  • SUCCESS: All tracks completed successfully
  • CREATE_TASK_FAILED: Task creation failed
  • GENERATE_AUDIO_FAILED: Audio generation failed
  • CALLBACK_EXCEPTION: Callback delivery failed
  • SENSITIVE_WORD_ERROR: Content policy violation

Operation Types

  • generate: Standard music generation from prompts
  • extend: Music extension/continuation
  • upload_cover: Audio style transformation
  • upload_extend: Audio extension with upload

Response Data Structure

Task Information

  • Task ID: Unique identifier for tracking
  • Parent Music ID: Reference to source audio (for extensions)
  • Parameters: Original generation settings used

Generated Content

Each successful task returns an array of generated music tracks with:
  • Audio URLs: Both download and streaming versions
  • Cover Images: Generated album artwork
  • Metadata: Title, tags, duration, creation time
  • Model Info: AI model version used

Polling Strategy

For tasks without callback URLs, implement polling:
async function pollTaskStatus(taskId) {
  const maxAttempts = 60; // Maximum 5 minutes
  const interval = 5000;  // Check every 5 seconds

  for (let attempt = 0; attempt < maxAttempts; attempt++) {
    const response = await getTaskDetails(taskId);

    if (response.data.status === 'SUCCESS') {
      return response.data;
    }

    if (response.data.status.includes('FAILED') ||
        response.data.status === 'SENSITIVE_WORD_ERROR') {
      throw new Error(response.data.errorMessage);
    }

    await new Promise(resolve => setTimeout(resolve, interval));
  }

  throw new Error('Task timeout');
}

Error Handling

Task Failures

When tasks fail, check:
  • Error Code: Numeric error identifier
  • Error Message: Detailed failure description
  • Status: Specific failure type

Common Issues

  • Content Policy: Lyrics or style violate guidelines
  • Audio Processing: Source file format or quality issues
  • Resource Limits: Insufficient credits or rate limits
  • Network Issues: Upload or callback URL problems

Best Practices

Efficient Polling

  • Start with 5-second intervals
  • Increase interval for longer-running tasks
  • Set reasonable timeout limits
  • Cache results to avoid redundant calls

Error Recovery

  • Retry on network errors
  • Check error messages for actionable feedback
  • Validate task IDs before polling
  • Implement exponential backoff for rate limits

Result Processing

  • Download audio files promptly (URLs may expire)
  • Save metadata for future reference
  • Verify audio quality and duration
  • Handle multiple tracks in results array
Use this endpoint as your primary method for tracking task progress and retrieving generation results when callback URLs are not suitable for your workflow.

Authorizations

Authorization
string
header
required

🔑 API Authentication

All endpoints require authentication using Bearer Token.

Get API Key

  1. Visit the API Key Management Page to obtain your API Key

Usage

Add to request headers:

Authorization: Bearer YOUR_API_KEY

⚠️ Note:

  • Keep your API Key secure and do not share it with others
  • If you suspect your API Key has been compromised, reset it immediately from the management page

Query Parameters

taskId
string
required

The task ID returned from the Generate Music or Extend Music endpoints. Used to identify the specific generation task to query.

Response

Request successful

code
enum<integer>

Status code. 200 - Request successful, 400 - Invalid parameters, 401 - Unauthorized access, 404 - Invalid request method or path, 405 - Rate limit exceeded, 413 - Theme or prompt too long, 429 - Insufficient credits, 430 - Your call frequency is too high. Please try again later, 455 - System maintenance, 500 - Server error

Available options:
200,
400,
401,
404,
405,
413,
429,
430,
455,
500
Example:

200

msg
string

Error message when code != 200

Example:

"success"

data
object