查询账单
curl --request GET \
--url https://api.highwayapi.ai/openapi/v1/billing/bill/list \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.highwayapi.ai/openapi/v1/billing/bill/list"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.highwayapi.ai/openapi/v1/billing/bill/list', 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://api.highwayapi.ai/openapi/v1/billing/bill/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://api.highwayapi.ai/openapi/v1/billing/bill/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.highwayapi.ai/openapi/v1/billing/bill/list")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/openapi/v1/billing/bill/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"bills": [
{
"userId": "<string>",
"startTime": "1790812800",
"endTime": "1790899199",
"billingMethod": 1,
"productName": "<string>",
"category": "llm",
"ownerID": "<string>",
"billNum0": "1000",
"billNum1": "500",
"basePrice0": "0",
"basePrice1": "0",
"discountPrice0": "0",
"discountPrice1": "0",
"originAmountDecimal": "1.23456789",
"amountDecimal": "1.000019",
"voucherAmountDecimal": "0",
"payableDecimal": "1.000019",
"payAmount": "10000",
"payAmountDisplay": 1,
"pricePrecision": 1,
"productId": "<string>",
"originAmount": "12345",
"amount": "10000",
"voucherAmount": "0"
}
]
}
API 基础
查询账单
GET
/
openapi
/
v1
/
billing
/
bill
/
list
查询账单
curl --request GET \
--url https://api.highwayapi.ai/openapi/v1/billing/bill/list \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>'import requests
url = "https://api.highwayapi.ai/openapi/v1/billing/bill/list"
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'}
};
fetch('https://api.highwayapi.ai/openapi/v1/billing/bill/list', 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://api.highwayapi.ai/openapi/v1/billing/bill/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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://api.highwayapi.ai/openapi/v1/billing/bill/list"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.highwayapi.ai/openapi/v1/billing/bill/list")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/openapi/v1/billing/bill/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"bills": [
{
"userId": "<string>",
"startTime": "1790812800",
"endTime": "1790899199",
"billingMethod": 1,
"productName": "<string>",
"category": "llm",
"ownerID": "<string>",
"billNum0": "1000",
"billNum1": "500",
"basePrice0": "0",
"basePrice1": "0",
"discountPrice0": "0",
"discountPrice1": "0",
"originAmountDecimal": "1.23456789",
"amountDecimal": "1.000019",
"voucherAmountDecimal": "0",
"payableDecimal": "1.000019",
"payAmount": "10000",
"payAmountDisplay": 1,
"pricePrecision": 1,
"productId": "<string>",
"originAmount": "12345",
"amount": "10000",
"voucherAmount": "0"
}
]
}
请求头
string
必填
枚举值:
application/jsonstring
必填
Bearer 身份验证格式: Bearer {{API 秘钥}}。
响应信息
string
必填
计费周期粒度。选项:
Hour:按小时Day: 按天Week:按周Month:按月
string
必填
产品类型。选项:
summary:汇总账单llm: 大语言模型
string
产品名称。支持模糊匹配。
string
查询账单周期的开始时间,时间戳(秒),默认值:0。
string
查询账单周期的结束时间,时间戳(秒),默认值:0。
string
指定要查询的实例 ID。
金额精度说明
Decimal 金额字段为十进制字符串,单位为美元,无需除以 10000。 具有对应 Decimal 字段的旧整数金额字段已标记为【弃用】,仍保留兼容,JSON 中以字符串返回,单位为 1/10000 美元。响应信息参数
object[]
必填
按需实例计费信息。
隐藏 属性
隐藏 属性
string
必填
实例所属的用户 ID。
string
必填
账单的开始时间。格式为 Unix 时间戳。
string
必填
账单的结束时间。格式为 Unix 时间戳。
int32
必填
实例的计费方式。值为 1 表示按需计费。
string
必填
产品名称。
string
必填
产品类别。
string
必填
实例 ID。
string
必填
- llm:输入 tokens
string
必填
- llm:输出 tokens
string
必填
原价
string
必填
无意义
string
必填
- llm:输入 tokens 单价
- 其他:单价
string
必填
- llm:输出 tokens 单价
string
必填
原始金额(未抵扣)。 十进制字符串,单位为美元。
string
必填
总价。 十进制字符串,单位为美元。
string
必填
代金券扣除金额。 十进制字符串,单位为美元。
string
必填
现金支付金额。 十进制字符串,单位为美元。
float
必填
int32
必填
价格精度。
string
必填
产品 ID。
string
必填
已弃用
【弃用】原始金额(未抵扣)。 整数以字符串返回,单位为 1/10000 美元。 请使用单位为美元的
originAmountDecimal。string
必填
已弃用
【弃用】总价。 整数以字符串返回,单位为 1/10000 美元。 请使用单位为美元的
amountDecimal。string
必填
已弃用
【弃用】代金券扣除金额。 整数以字符串返回,单位为 1/10000 美元。 请使用单位为美元的
voucherAmountDecimal。string
必填
已弃用
【弃用】现金支付金额。 整数以字符串返回,单位为 1/10000 美元。 请使用单位为美元的
payableDecimal。{
"bills": [
{
"userId": "<string>",
"startTime": "1790812800",
"endTime": "1790899199",
"billingMethod": 1,
"productName": "<string>",
"category": "llm",
"ownerID": "<string>",
"billNum0": "1000",
"billNum1": "500",
"basePrice0": "0",
"basePrice1": "0",
"discountPrice0": "0",
"discountPrice1": "0",
"originAmountDecimal": "1.23456789",
"amountDecimal": "1.000019",
"voucherAmountDecimal": "0",
"payableDecimal": "1.000019",
"payAmount": "10000",
"payAmountDisplay": 1,
"pricePrecision": 1,
"productId": "<string>",
"originAmount": "12345",
"amount": "10000",
"voucherAmount": "0"
}
]
}
最后修改于 2026年10月21日