Query Balance Customers can query the organization balance programmatically with an API key (prefixed sk_live_) — no login session required. The API accepts API key authentication only, and the balance is organization-level.
Put the API key in the request header:
Authorization: Bearer sk_live_YOUR_API_KEY
API keys are created on the console "API Keys" page, bound to an organization and a project.
GET /api/business/v1/customer/balance
查询余额
Return the current balance for the API key's organization. API key only.
🔑 Bearer API Key Use the Authorization: Bearer sk_live_... header; x-api-key is also supported.
Request structure The section below confirms the method, URL and authentication scheme. It is an HTTP structure snippet, not a standalone runnable example.
GET https://www.silvamux.com/api/business/v1/customer/balance
Authorization: Bearer $SILVAMUX_API_KEYRequest parameters Parameter Type & location Required Description Authorizationstring · header Yes Bearer API Key (sk_live_...) X-Organization-Idstring · header No Not required for API key auth
Response 200OK application/json · CustomerBalanceResponse
Field Type Required Description $schemastring (uri) No A URL to the JSON Schema for this object. balance_pointsstring Yes Current balance in points
defaultError application/problem+json · ErrorModel
Field Type Required Description $schemastring (uri) No A URL to the JSON Schema for this object. detailstring No A human-readable explanation specific to this occurrence of the problem. errorsarray<ErrorDetail> No Optional list of individual error details errors.locationstring No Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id' errors.messagestring No Error message text errors.valueany No The value at the given location instancestring (uri) No A URI reference that identifies the specific occurrence of the problem. statusinteger (int64) No HTTP status code titlestring No A short, human-readable summary of the problem type. This value should not change between occurrences of the error. typestring (uri) No A URI reference to human-readable documentation for the error.;Default: about:blank
curl https://www.silvamux.com/api/business/v1/customer/balance \
-H "Authorization: Bearer $SILVAMUX_API_KEY "
# pip install requests
import os
import requests
resp = requests.get(
"https://www.silvamux.com/api/business/v1/customer/balance",
headers={"Authorization": f"Bearer {os.environ['SILVAMUX_API_KEY']}"},
)
resp.raise_for_status()
print(resp.json()) # {"balance_points": "42.5"}
// Node 18+ (built-in fetch)
const resp = await fetch(
"https://www.silvamux.com/api/business/v1/customer/balance",
{
headers: { Authorization: `Bearer ${process.env.SILVAMUX_API_KEY}` },
},
);
const data = await resp.json();
console.log(data); // { balance_points: "42.5" }
// Standard library only
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://www.silvamux.com/api/business/v1/customer/balance", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SILVAMUX_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
cURL Python JavaScript Go
Response:
{
"balance_points" : "42.5"
}
Field Description balance_pointsCurrent balance (points)
HTTP Code Description 401 INVALID_TOKENAPI key missing or invalid