Other APIs / open-api-balance.md

Balance API

Overview

Balance API Query the current user's account balance, can use and.

as (mm, image/video/audio) and Model (llm, Model); as (USD) and (CNY)., query in thewallets localized example text.

endpoint-endpointPath: /api/v2/open/balance - RequestMethod: `GET` - Authentication: Bearer Token (API Key)

Request Parameters

Headers

Parameterlocalized example textTypeRequiredDescription
AuthorizationstringYesBearer {API_KEY}

Query Parameters

no## Response Format

Successlocalized example text```json { "code": 0, "msg": "success", "data": { "userId": "user@example.com", "balance": "100.50", "frozenBalance": "5.00", "currency": "USD", "wallets": [ { "currency": "USD", "balance": "100.50", "frozenBalance": "5.00", "wallet": "mm" }, { "currency": "CNY", "balance": "500.00", "frozenBalance": "0", "wallet": "mm" }, { "currency": "USD", "balance": "270", "frozenBalance": "0", "wallet": "llm" } ] } }


### fieldDescription| fieldlocalized example text| Type | Description |
|--------|------|------|
| userId | string | ID|
| balance | string | can use (field, Note)|
| frozenBalance | string | (field)|
| currency | string | as`USD` (field)|
| wallets | array | localized example text|
| wallets[].currency | string |:`USD` ()/`CNY` ()|
| wallets[].balance | string | can use|
| wallets[].frozenBalance | string | (`llm` as`0`) |
| wallets[].wallet | string | Type:`mm` ()/`llm` (Model)|

### Errorlocalized example text```json
{
 "code": 10005,
 "msg": "API Key no",
 "data": null
}
{
 "code": 90003,
 "msg": "query Failure",
 "data": null
}

Request Example

cURL

curl -X GET "https://mm-internal-cn.leonecloud.com/api/v2/open/balance" \
 -H "Authorization: Bearer your_api_key_here"

Python

import requests

url = "https://mm-internal-cn.leonecloud.com/api/v2/open/balance"
headers = {
 "Authorization": "Bearer your_api_key_here"
}

data = requests.get(url, headers=headers).json()["data"]
for wallet in data["wallets"]:
 print(wallet["wallet"], wallet["currency"], wallet["balance"])

JavaScript

fetch('https://mm-internal-cn.leonecloud.com/api/v2/open/balance', {
 method: 'GET',
 headers: {
 'Authorization': 'Bearer your_api_key_here'
 }
}).then(response => response.json()).then(({ data }) => {
 data.wallets.forEach(w => console.log(w.wallet, w.currency, w.balance));
});

use Scenario

  1. query: in API first, Query Account Balance,
  2. localized example text: query, when and when
  3. localized example text: in task complete after query,## Note1. localized example textwallets:localized example textbalance / frozenBalance / currency as field, return, Model., field will return0 / USD, inwallets in
  4. can:,, Model, and,.localized example textwallet + currency 3. wallets; not will in in the array ( will 0 return ).with whenwallets as, return0
  5. balance first can use,, nofrozenBalance
  6. not complete task:taskSuccess after, taskFailure can use
  7. recommendedin API first query, Insufficient balancetaskFailure## Model (LLM)
  • Model (LLM)Capability,wallets in willwallet asllm, Model can use; not return.
  • Modelbalance,; Model with,frozenBalance as0.
  • Model and first「localized example text」/「localized example text」, in in.

Error CodesDescription

Error CodesDescriptionlocalized example text
10005API Key invalid or missingAuthorization Format and API Key
10004nolocalized example text
90003query Failureafter or Technical Support
Updated 2026-10-27