Usage
curl --request GET \
--url https://api.k-router.com/v1/usage \
--header 'Authorization: <authorization>'import requests
url = "https://api.k-router.com/v1/usage"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.k-router.com/v1/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://api.k-router.com/v1/usage",
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>"
],
]);
$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.k-router.com/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
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.k-router.com/v1/usage")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.k-router.com/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyAPI Reference
Usage
잔여 한도 및 사용량 조회
GET
/
v1
/
usage
Usage
curl --request GET \
--url https://api.k-router.com/v1/usage \
--header 'Authorization: <authorization>'import requests
url = "https://api.k-router.com/v1/usage"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://api.k-router.com/v1/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://api.k-router.com/v1/usage",
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>"
],
]);
$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.k-router.com/v1/usage"
req, _ := http.NewRequest("GET", url, nil)
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.k-router.com/v1/usage")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.k-router.com/v1/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_bodyGET /v1/usage
인증된 사용자의 잔여 한도(USD)와 사용량을 조회합니다.헤더
Bearer kr-your-api-key응답
200 - 성공
{
"credits_remaining": 120.50,
"credits_used": 29.50,
"usage_this_month": 12.34,
"customer": {
"name": "My Company",
"credits": 120.50
},
"recentUsage": [
{
"model": "kr/gpt54",
"inputTokens": 150,
"outputTokens": 500,
"credits": 0.02,
"createdAt": "2026-03-20T04:00:00.000Z"
}
]
}
응답 필드
| 필드 | 타입 | 설명 |
|---|---|---|
credits_remaining | number | 잔여 한도 (USD) |
credits_used | number | 총 사용 금액 (USD) |
usage_this_month | number | 이번 달 사용 금액 (USD) |
recentUsage | array | 최근 50건 사용 내역 |
모든 금액은 USD 단위로 표시됩니다.
예시
cURL
curl https://api.k-router.com/v1/usage \
-H "Authorization: Bearer kr-your-api-key"
Python
import requests
r = requests.get(
"https://api.k-router.com/v1/usage",
headers={"Authorization": "Bearer kr-your-api-key"}
)
data = r.json()
print(f"잔여 한도: ${data['credits_remaining']}")
print(f"이번 달 사용: ${data['usage_this_month']}")
⌘I