Query Bills
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 Basics
Query Bills
GET
/
openapi
/
v1
/
billing
/
bill
/
list
Query Bills
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>"
}
]
}Request Headers
string
required
Enum value:
application/jsonstring
required
Bearer authentication format: Bearer {{API Key}}.
Response Information
string
required
Billing cycle granularity. Options:
Hour: hourlyDay: dailyWeek: weeklyMonth: monthly
string
required
Product type. Options:
summary: summary billllm: large language model
string
Product name. Fuzzy matching is supported.
string
Start time of the billing cycle to query, as a timestamp (seconds). Default value: 0.
string
End time of the billing cycle to query, as a timestamp (seconds). Default value: 0.
string
Specify the instance ID to query.
Response Parameters
object[]
required
Pay-as-you-go instance billing information.
Hide Properties
Hide Properties
string
required
User ID to which the instance belongs.
string
required
Start time of the bill. Format: Unix timestamp.
string
required
End time of the bill. Format: Unix timestamp.
string
required
Billing method of the instance. A value of 1 indicates pay-as-you-go billing.
string
required
Product name.
string
required
Product category.
string
required
Instance ID.
string
required
- llm: input tokens
string
required
- llm: output tokens
string
required
Original price
string
required
Not meaningful
string
required
- llm: unit price for input tokens
- Other: unit price
string
required
- llm: unit price for output tokens
string
required
Total price.
string
required
Amount deducted by voucher.
string
required
Cash payment amount.
string
required
string
required
Price precision.
string
required
Product ID.
⌘I