Skip to main content
GET
/
v1
/
usage
Retrieve advanced API usage analytics
curl --request GET \
  --url https://supertoneapi.com/v1/usage \
  --header 'x-sup-api-key: <api-key>'
import requests

url = "https://supertoneapi.com/v1/usage"

headers = {"x-sup-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-sup-api-key': '<api-key>'}};

fetch('https://supertoneapi.com/v1/usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://supertoneapi.com/v1/usage"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-sup-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://supertoneapi.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 => [
"x-sup-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpResponse<String> response = Unirest.get("https://supertoneapi.com/v1/usage")
.header("x-sup-api-key", "<api-key>")
.asString();
{
  "data": [
    {
      "starting_at": "2024-01-01T00:00:00+09:00",
      "ending_at": "2024-01-01T01:00:00+09:00",
      "results": [
        {
          "minutes_used": 123,
          "voice_id": "<string>",
          "voice_name": "<string>",
          "api_key": "<string>",
          "model": "<string>"
        }
      ]
    }
  ],
  "total": 123,
  "next_page_token": "<string>"
}
{
"status": "error",
"message": "Invalid request data"
}
{
"status": "error",
"message": {
"message": "Invalid API Key",
"error": "Unauthorized"
}
}
{
"status": "error",
"message": {
"message": "Request timed out",
"error": "Request Timeout"
}
}
{
"status": "error",
"message": {
"message": "Failed to convert text to speech",
"error": "Internal Server Error"
}
}
이 문서는 영어 원문을 기반으로 자동 번역되었습니다. 표현이 어색하거나 모호한 부분이 있을 수 있으니, 정확한 내용은 영어 원문을 함께 확인해 주세요.
생성된 오디오 분량을 시간 버킷으로 집계하여 반환하며, 선택적으로 보이스, API 키, 모델별로 분해할 수 있습니다. 대시보드, 내부 리포팅, 키별 사용량 귀속에 사용해 주십시오. 날짜별 보이스 단위의 간단한 집계는 Get voice usage를 사용해 주십시오.

엔드포인트

GET https://supertoneapi.com/v1/usage

쿼리 파라미터

NameRequiredDescriptionExample
start_timeRFC3339 형식의 시작 시각입니다.2025-05-01T00:00:00+00:00
end_timeRFC3339 형식의 종료 시각입니다.2025-05-31T23:59:59+00:00
bucket_widthhour 또는 day. 기본값 day.day
breakdown_type분해 차원 배열입니다: voice_id, voice_name, api_key, model.["voice_name"]
page_size페이지당 항목 수입니다(1~20). 기본값 10.10
next_page_token이전 응답의 토큰입니다.eyJpZCI6IjEyMzQ1In0=

제약사항

  • 단일 요청의 breakdown_typevoice_idvoice_name동시에 포함할 수 없습니다.
  • start_timeend_time의 UTC 오프셋이 다르면 end_time의 오프셋은 무시됩니다 — 동일한 오프셋을 사용해 주십시오.
  • breakdown_type을 생략하면 응답은 버킷별 총 생성 시간만 반환하며 차원별 분해는 포함하지 않습니다.

함께 보기

Docs: Cost and usage

프로덕션에서 지출을 모니터링하는 패턴입니다.

Get voice usage

날짜별 보이스 단위의 간단한 집계입니다.

Authorizations

x-sup-api-key
string
header
required

Query Parameters

start_time
string
required

Start time in RFC3339 format

Example:

"2024-01-01T00:00:00+09:00"

end_time
string
required

End time in RFC3339 format

Example:

"2024-01-31T23:59:59+09:00"

bucket_width
enum<string>
default:day

Time bucket width for aggregation

Available options:
hour,
day
breakdown_type
enum<string>[]

Dimensions to break down usage data

Available options:
voice_id,
voice_name,
api_key,
model
Example:
["voice_name"]
page_size
number
default:10

Number of results per page

Required range: 1 <= x <= 20
next_page_token
string

Pagination token from previous response

Response

Usage analytics data successfully retrieved.

data
object[]
required

Array of time buckets containing usage data

total
number
required

Total number of time buckets across all pages

next_page_token
string

Pagination token for next page