Hesap bakiyesi sorgulama API'si

2026-09-18 tarihinde güncellendi · Suno-API ekibi

Uç nokta açıklaması

Hesap bakiyesi sorgulama, kullanıcının kendi API anahtarıyla New API hesap bakiyesini kontrol etmesini sağlar. Bu uç nokta yalnızca bakiyeyi sorgular; üretim görevi başlatmaz ve hiçbir ücret almaz.

Uç nokta: GET /api/user/balance

Faturalama: Ücretsiz.

Baki birimi: yuan. Yanıtta effective_amount, quota_per_unit ile kullanıcının anlayabileceği yuan tutarına dönüştürülmüştür.

İstek parametreleri

Headers

Parametre Tür Zorunlu Notlar
Authorization string evet Bearer YOUR_API_KEY

Sorgu parametreleri

Yok.

İstek örnekleri

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"];
?>

Yanıt

{
  "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"
    }
  }
}

Alan referansı

Alan Tür Notlar
balance.user_quota number Kullanıcı hesabının kalan kotasının ham değeri
balance.token_quota number Geçerli API anahtarının kalan kotasının ham değeri; sınırsız kotaya sahip anahtar kullanıcı bakiyesini döndürür
balance.effective_quota number Geçerli API anahtarının gerçekten kullanabileceği kotanın ham değeri
balance.effective_amount number Dönüştürmeden sonra gerçekten kullanılabilir tutar
balance.amount_unit string yuan olarak sabit
balance.formatted_effective_amount string Kullanıcıya doğrudan gösterilebilecek baki metni
display.quota_per_unit number Ham kotanın dönüştürme birimi; tutar = quota / quota_per_unit

Notlar

SonrakiBasit mod üretim API'si

API anahtarı alın

Kaydolduktan sonra konsoldan bir API anahtarı oluşturun. Her üretim 0,6 ¥ tutarındadır ve 2 parça döner, indirmeler sınırsızdır ve telefon numarası gerekmez.

API anahtarı al Genel bakışa dön