Get balance
curl --request GET \
--url https://openp.ai/v1/dashboard/billing/subscriptionimport requests
url = "https://openp.ai/v1/dashboard/billing/subscription"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://openp.ai/v1/dashboard/billing/subscription', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openp.ai/v1/dashboard/billing/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/v1/dashboard/billing/subscription"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openp.ai/v1/dashboard/billing/subscription")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/dashboard/billing/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyAccount
Get balance
GET /v1/dashboard/billing/subscription — the current account quota
GET
/
v1
/
dashboard
/
billing
/
subscription
Get balance
curl --request GET \
--url https://openp.ai/v1/dashboard/billing/subscriptionimport requests
url = "https://openp.ai/v1/dashboard/billing/subscription"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://openp.ai/v1/dashboard/billing/subscription', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://openp.ai/v1/dashboard/billing/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://openp.ai/v1/dashboard/billing/subscription"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://openp.ai/v1/dashboard/billing/subscription")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/dashboard/billing/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyReturns the current account’s (or token’s) balance and quota information.
Field meanings:
Request
curl https://openp.ai/v1/dashboard/billing/subscription \
-H "Authorization: Bearer $OPENPAI_API_KEY"
Response
{
"object": "billing_subscription",
"has_payment_method": true,
"soft_limit_usd": 100.0,
"hard_limit_usd": 1000.0,
"system_hard_limit_usd": 1000.0,
"access_until": 4102444800,
"plan": {"title": "vip", "id": "vip"}
}
| Field | Meaning |
|---|---|
hard_limit_usd | The account’s (or token’s) hard quota ceiling |
soft_limit_usd | The soft quota threshold (triggers an alert) |
system_hard_limit_usd | The system-level hard ceiling |
access_until | The Unix time when account access ends (0 means permanent) |
plan | The current group |
Differences from official OpenAI
OpenPAI’s query endpoint is compatible with OpenAI’s legacy structure. For more fine-grained information (account balance, current token’s spend, used quota, etc.), use the dedicated endpoint:# Query account-level balance (in ¥)
curl https://openp.ai/api/user/self \
-H "Authorization: Bearer $OPENPAI_USER_TOKEN"
A user token and an API key (sk-) are two separate credentials — the user token is for the management backend API, while sk- is for model calls.
Client integration
Many clients (such as NextChat, ChatBox) automatically call/v1/dashboard/billing/subscription and /v1/dashboard/billing/usage to display the balance.
OpenPAI implements both endpoints so client UIs work correctly.