API kueri saldo akun

Diperbarui 2026-09-18 · tim Suno-API

Deskripsi endpoint

Kueri saldo akun memungkinkan pengguna memeriksa saldo akun New API mereka dengan kunci API miliknya sendiri. Endpoint ini hanya menanyakan saldo; tidak memicu tugas pembuatan dan tidak menagih apa pun.

Endpoint: GET /api/user/balance

Biaya: Gratis.

Satuan saldo: yuan. Pada respons, effective_amount sudah dikonversi dengan quota_per_unit menjadi jumlah yuan yang dapat dipahami pengguna.

Parameter permintaan

Headers

Parameter Tipe Wajib Catatan
Authorization string ya Bearer YOUR_API_KEY

Parameter query

Tidak ada.

Contoh permintaan

cURL

curl -X GET https://www.suno-api.io/api/user/balance \
  -H "Authorization: Bearer YOUR_API_KEY"

Python

import requests

api_key = "YOUR_API_KEY"
response = requests.get(
    "https://www.suno-api.io/api/user/balance",
    headers={"Authorization": f"Bearer {api_key}"},
    timeout=30,
)
response.raise_for_status()

result = response.json()
balance = result["data"]["balance"]
print(balance["formatted_effective_amount"])

Node.js

const apiKey = "YOUR_API_KEY";

const response = await fetch("https://www.suno-api.io/api/user/balance", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${apiKey}`,
  },
});

if (!response.ok) {
  throw new Error(`HTTP ${response.status}`);
}

const result = await response.json();
console.log(result.data.balance.formatted_effective_amount);

PHP

<?php
$apiKey = "YOUR_API_KEY";

$ch = curl_init("https://www.suno-api.io/api/user/balance");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer " . $apiKey
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
if ($response === false) {
    throw new Exception(curl_error($ch));
}
curl_close($ch);

$result = json_decode($response, true);
echo $result["data"]["balance"]["formatted_effective_amount"];
?>

Respons

{
  "success": true,
  "message": "",
  "data": {
    "object": "user_balance",
    "user": {
      "id": 123,
      "username": "example",
      "quota": 207900000,
      "used_quota": 0,
      "request_count": 10,
      "group": "default",
      "status": 1
    },
    "token": {
      "id": 456,
      "name": "default",
      "group": "default",
      "status": 1,
      "remain_quota": 207900000,
      "used_quota": 0,
      "unlimited_quota": true,
      "model_limits_enabled": false,
      "model_limits": {}
    },
    "balance": {
      "user_quota": 207900000,
      "token_quota": 207900000,
      "effective_quota": 207900000,
      "user_amount": 415.8,
      "token_amount": 415.8,
      "effective_amount": 415.8,
      "amount_unit": "yuan",
      "formatted_effective_amount": "415.80 yuan"
    },
    "display": {
      "quota_per_unit": 500000,
      "amount_unit": "yuan"
    }
  }
}

Referensi field

Field Tipe Catatan
balance.user_quota number Nilai mentah sisa kuota akun pengguna
balance.token_quota number Nilai mentah sisa kuota kunci API saat ini; kunci tanpa batas mengembalikan saldo pengguna
balance.effective_quota number Nilai mentah kuota yang benar-benar dapat dipakai kunci API saat ini
balance.effective_amount number Jumlah yang benar-benar tersedia setelah konversi
balance.amount_unit string Tetap yuan
balance.formatted_effective_amount string String saldo yang bisa langsung ditampilkan ke pengguna
display.quota_per_unit number Satuan konversi kuota mentah; jumlah = quota / quota_per_unit

Catatan

BerikutnyaAPI pembuatan mode sederhana

Dapatkan kunci API

Buat kunci API di konsol setelah mendaftar. Setiap pembuatan berbiaya 0,6 ¥ dan menghasilkan 2 lagu, unduhan tidak terbatas, dan nomor telepon tidak diperlukan.

Ambil kunci API Kembali ke ringkasan