查询账单
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": "<string>",
"endTime": "<string>",
"billingMethod": "<string>",
"productName": "<string>",
"category": "<string>",
"ownerID": "<string>",
"billNum0": "<string>",
"billNum1": "<string>",
"basePrice0": "<string>",
"basePrice1": "<string>",
"discountPrice0": "<string>",
"discountPrice1": "<string>",
"amount": "<string>",
"voucherAmount": "<string>",
"payAmount": "<string>",
"payAmountDisplay": "<string>",
"pricePrecision": "<string>",
"productId": "<string>"
}
]
}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": "<string>",
"endTime": "<string>",
"billingMethod": "<string>",
"productName": "<string>",
"category": "<string>",
"ownerID": "<string>",
"billNum0": "<string>",
"billNum1": "<string>",
"basePrice0": "<string>",
"basePrice1": "<string>",
"discountPrice0": "<string>",
"discountPrice1": "<string>",
"amount": "<string>",
"voucherAmount": "<string>",
"payAmount": "<string>",
"payAmountDisplay": "<string>",
"pricePrecision": "<string>",
"productId": "<string>"
}
]
}请求头
枚举值:
application/jsonBearer 身份验证格式: Bearer {{API 秘钥}}。
响应信息
计费周期粒度。选项:
Hour:按小时Day: 按天Week:按周Month:按月
产品类型。选项:
summary:汇总账单llm: 大语言模型
产品名称。支持模糊匹配。
查询账单周期的开始时间,时间戳(秒),默认值:0。
查询账单周期的结束时间,时间戳(秒),默认值:0。
指定要查询的实例 ID。
响应信息参数
按需实例计费信息。
隐藏 属性
隐藏 属性
实例所属的用户 ID。
账单的开始时间。格式为 Unix 时间戳。
账单的结束时间。格式为 Unix 时间戳。
实例的计费方式。值为 1 表示按需计费。
产品名称。
产品类别。
实例 ID。
- llm:输入 tokens
- llm:输出 tokens
原价
无意义
- llm:输入 tokens 单价
- 其他:单价
- llm:输出 tokens 单价
总价。
代金券扣除金额。
现金支付金额。
价格精度。
产品 ID。
⌘I