Get balance
Endpoint
GET
/v1/billing/balanceReturns the available balance of the account that owns the API key. The account is identified by the key; no other parameters are needed.
Request
Authenticate with Authorization: Bearer sk-moyiapi-xxxxxx. No query parameters.
Parameters
None.
Response
{
"balance": {"value": "85.320000", "currency": "USD"}
}
| Field | Notes |
|---|---|
balance.value |
Available balance as a string amount |
balance.currency |
Currency |
Examples
curl "https://moyiapi.com/v1/billing/balance" \
-H "Authorization: Bearer sk-moyiapi-xxxxxx"
Errors
| HTTP status | error.type |
When it happens |
|---|---|---|
| 401 | missing_auth_credential / invalid_bearer_token |
Authentication failed; see Authentication |