![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/gocodeme.com/public_html/BACKUP/ |
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html>
<html>
<head>
<title>Suno API Test - MusicStudio Pro</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; }
.success { color: green; }
.error { color: red; }
.warning { color: orange; }
pre { background: #f5f5f5; padding: 10px; border-radius: 5px; margin: 10px 0; }
.test-section { border: 1px solid #ddd; padding: 15px; margin: 15px 0; border-radius: 5px; }
</style>
</head>
<body>
<h1>🔍 Suno API Test</h1>
<?php
$API_KEY = '63edba40620216c5aa2c04240ac41dbd';
// Test different possible Suno API URLs
$possible_urls = [
'https://api.suno.ai',
'https://api.suno.ai/v1',
'https://api.suno.ai/v2',
'https://api.suno.com',
'https://api.suno.com/v1',
'https://suno-api.ai',
'https://suno-api.com'
];
foreach ($possible_urls as $base_url) {
echo "<div class='test-section'>";
echo "<h2>Testing: $base_url</h2>";
// Test basic connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $base_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
echo "<p><strong>Basic Connection (HTTP $httpCode):</strong></p>";
if ($error) {
echo "<p class='error'>Error: $error</p>";
} else {
echo "<pre>" . htmlspecialchars($response) . "</pre>";
}
// Test music generation endpoint
$testData = [
'prompt' => 'A peaceful acoustic guitar melody',
'model' => 'v3',
'duration' => 10
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $base_url . '/music/generate');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($testData));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $API_KEY,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "<p><strong>Music Generation (HTTP $httpCode):</strong></p>";
echo "<pre>" . htmlspecialchars($response) . "</pre>";
// If we get a 200 or 201, this might be the right URL
if ($httpCode == 200 || $httpCode == 201) {
echo "<p class='success'>🎉 This might be the correct API URL!</p>";
}
echo "</div>";
}
echo "<div class='test-section'>";
echo "<h2>🔍 What This Means</h2>";
echo "<p>The api.box URLs are all returning 404 errors, which means:</p>";
echo "<ul>";
echo "<li>❌ The API URL is incorrect</li>";
echo "<li>❌ The service might not exist</li>";
echo "<li>❌ Your API key might be for a different service</li>";
echo "</ul>";
echo "<p><strong>Next Steps:</strong></p>";
echo "<ul>";
echo "<li>Check where you got your API key from</li>";
echo "<li>Look for the correct API documentation</li>";
echo "<li>The key might be for Suno, not api.box</li>";
echo "</ul>";
echo "</div>";
?>
<hr>
<h2>🔗 Quick Links</h2>
<ul>
<li><a href="musicstudio.html">🎵 MusicStudio Pro</a></li>
<li><a href="debug_api.php">🔍 API Debug</a></li>
<li><a href="diagnostic.php">🔧 Server Diagnostic</a></li>
</ul>
</body>
</html>