Get usage
curl --request GET \
--url https://openp.ai/v1/dashboard/billing/usageimport requests
url = "https://openp.ai/v1/dashboard/billing/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://openp.ai/v1/dashboard/billing/usage', 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/usage",
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/usage"
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/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/dashboard/billing/usage")
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 usage
GET /v1/dashboard/billing/usage — spend over a time range
GET
/
v1
/
dashboard
/
billing
/
usage
Get usage
curl --request GET \
--url https://openp.ai/v1/dashboard/billing/usageimport requests
url = "https://openp.ai/v1/dashboard/billing/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://openp.ai/v1/dashboard/billing/usage', 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/usage",
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/usage"
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/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://openp.ai/v1/dashboard/billing/usage")
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_bodyQuery the cumulative spend over a specified time range (in USD).
Maximum span 100 days.
It returns, for each call: model, tokens, latency, charge, Request ID, IP and more.
Request
curl "https://openp.ai/v1/dashboard/billing/usage?start_date=2026-05-01&end_date=2026-05-15" \
-H "Authorization: Bearer $OPENPAI_API_KEY"
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | ✅ | YYYY-MM-DD, inclusive of this day |
end_date | string | ✅ | YYYY-MM-DD, exclusive of this day |
Response
{
"object": "list",
"total_usage": 12.43,
"daily_costs": [
{
"timestamp": 1714521600,
"line_items": [
{"name": "gpt-5.5", "cost": 1.20},
{"name": "gpt-5.5", "cost": 0.15}
]
}
]
}
total_usage is in USD ×100 (i.e. 12.43 = $0.1243), consistent with OpenAI’s convention.
However, the OpenPAI console / logs display in RMB; refer to the console for the exact conversion.
Finer granularity
For per-request logs, use Console → Logs, or the dedicated API:curl "https://openp.ai/api/log/self?page=1&page_size=50" \
-H "Authorization: Bearer $OPENPAI_USER_TOKEN"