# How do I set up provider balance queries?

> Cube Agent 2.4.1 Release (Build 2004105) User Guide.
> Category: Models & AI. Content baseline: 2026-12-05.
> Web page: https://cubeagent.app/en/docs/provider_balance/

## Balance queries and the split-pane model picker

Providers with a configured balance endpoint display their account balance directly in the **Settings → Models & usage → Provider Management** list. The chat page's **Select Model** panel defaults to a **split-pane** layout with a left rail (giving one-screen access on the left to Favorites and each provider with a compact balance, while the right pane displays the selected provider's full balance and model list). Tap **List / Split** in the top bar to switch back to the single-column pill view—your preference is saved on-device. Inside **Favorites**, you can also set it as the default opening tab with one tap (automatically falling back to the current provider if no favorite matches the current scenario). You can filter quickly by capability (reasoning, vision, tools, web search, etc.), type to switch automatically to full-width cross-provider search, refresh all balances at once, or refresh and retry a single provider individually.

Setup location: Provider Details page → **Account Balance** section.

## Option 1: Choose a template

Pick from preset templates such as DeepSeek, Kimi, StepFun, OpenRouter, and others. Selecting a template fills in the balance URL, API path, and parsing rules; save and query to verify. If a template does not match, adjust the URL and result path manually.

SiliconFlow's original balance query endpoint has been discontinued, and no replacement balance query API is currently available. You can check your balance directly in the SiliconFlow console.

## Option 2: Set up with AI

Tap **Set up with AI** in the Account Balance section and pick a management model. The session pre-fills a setup request for the current provider. Paste the API documentation or instructions from your provider's console before sending; the AI tests the live endpoint and refines the parsing path from the real response. A confirmation panel appears before any settings are saved.

## Custom endpoint

- **Balance Base URL / Balance API Path**: Leave Base URL empty to use the provider's primary Base URL.
- **GET / POST override**: Switch the method to POST if the API requires it, and fill in **Request Body Template (JSON)**.
- **Custom Headers (JSON object, optional)**: Sends `Accept` and `Authorization: Bearer` headers by default; any header with the same name is overridden by your value.
- **Placeholders**: Request body and custom headers support `{{apiKey}}` and `{{baseUrl}}`.
- **Result JSON Path / Currency JSON Path**: Specify where the balance value and currency appear in the response. Supports dot paths, array indices, and `+`/`-` expressions, with plain numbers treated as constants (for example, `100 - usage.monthly.percent` to calculate remaining percentage). When an API relay returns raw quota units that require conversion, append **`* <positive number>`** or **`/ <positive number>`** after a single path—such as `data.quota / 500000` (OneAPI-based relays typically divide `quota` by `500000` to convert to USD).
- **Dedicated Balance Key (optional)**: For providers whose balance API uses different credentials from the model API, enter a dedicated key here; when set, balance queries use it first.

## Request preview (redacted)

The preview assembles the actual outgoing request in real time based on your current settings, with credentials masked. Check it before sending to spot mistyped URLs or the wrong HTTP method in advance.

## Best practices

- Start with a template whenever available, and test after each change rather than batching multiple edits together.
- If the request succeeds but the amount looks wrong, inspect **Result JSON Path** first—usually the number is nested under another field. An unusually huge number (such as tens of millions) usually indicates raw relay quota units that need a divisor such as `/ 500000`.
- When a relay uses a different balance API from the official provider, use a **Dedicated Balance Key** or separate Base URL so model calls are unaffected.
- If an uncommon API is tricky to parse, hand it to the AI agent: paste the documentation and let it test until the displayed balance is accurate.

## Privacy note

Balance queries are sent directly from the app to your configured provider without passing through Cube Agent servers. When you use AI setup, the endpoint URL and documentation you provide are sent to your selected management model.
