Запрос счетов
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/jsonФормат Bearer-аутентификации: 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