Lingara Lingara 문서 학습 가이드 API 라이브러리 앱 만들기 웹 앱
언어: 한국어

남은 사용 한도 가져오기

API 버전 2026-10-affable-towhee

get https://api.getlingara.com/v1/usage

계정에 적용되는 각 사용 한도를 사용량과 초기화 시점과 함께 나열합니다.

스코프 usage:read

매개변수

Lingara-Versionheaderstring선택
이 요청에 응답할 API 버전입니다. 지정하지 않으면 액세스 토큰은 해당 클라이언트에 고정된 버전을, 토큰이 없는 요청은 현재 버전을 받습니다. 개발 중인 버전은 여기에서 지정해야만 사용할 수 있습니다. 알 수 없는 버전에는 코드 api_version_unknown과 함께 400으로 응답합니다. GET /v1/versions에서 버전 목록을 확인할 수 있습니다.

응답

200 사용 한도

allowancearray of AllowanceRow필수
featurestring필수
windowstring필수
limitinteger필수
usedinteger필수
remaininginteger필수
reset_atinteger | null선택
ledgerUsageLedger | null선택

매월 1일 UTC 자정 이후 이 클라이언트의 호출 수와 단위 수입니다. 사용량 기반 과금 클라이언트에만 포함되며, 그 호출은 사용 한도를 소모하지 않습니다. 최근 호출보다 최대 5초 늦게 반영될 수 있습니다.

sincestring필수
callsinteger필수
unitsinteger필수

오류

410application/json
이 요청에 응답하는 API 버전은 지원이 종료되었습니다. Lingara-Version에 지원되는 버전을 보내거나 클라이언트를 다른 버전에 다시 고정하세요.
4XXapplication/json
요청이 거부되었습니다. code는 이유를, error는 이를 문장으로 알려 줍니다.
503application/json · text/plain
서비스를 일시적으로 사용할 수 없습니다. Retry-After에 있는 초만큼 기다린 후 다시 시도하세요. 점검 중에는 본문이 오류 엔벨로프가 아닌 일반 텍스트입니다.
5XXapplication/json
요청이 거부되었습니다. code는 이유를, error는 이를 문장으로 알려 줍니다.
codestring필수

요청이 거부된 이유를 분기에 쓸 수 있는 안정적인 코드로 나타냅니다. 예: insufficient_scope(403), rate_limited(429), 사용량 기반 과금 클라이언트의 경우 spend_cap_reached(402)와 metered_billing_inactive(402).

errorstring필수

예시

코드 예제 언어

curl

curl "https://api.getlingara.com/v1/usage" \
  -H "Authorization: Bearer $LINGARA_TOKEN"

TypeScript

const usage = await client.getUsage();
for (const row of usage.allowance) {
  console.log(row.feature, row.window, `${row.remaining} of ${row.limit} left`);
}

Rust

let usage = client.get_usage().await?;
for row in &usage.allowance {
    println!("{} {}: {} of {} left", row.feature, row.window, row.remaining, row.limit);
}

Go

usage, err := client.GetUsage(ctx)
if err != nil {
	return err
}
for _, row := range usage.Value.Allowance {
	fmt.Printf("%s (%s): %d of %d left\n", row.Feature, row.Window, row.Remaining, row.Limit)
}

Java

import com.getlingara.client.model.AllowanceRow;
import com.getlingara.client.model.Usage;

Usage usage = client.getUsage().body();
for (AllowanceRow row : usage.getAllowance()) {
  System.out.println(
      row.getFeature()
          + " ("
          + row.getWindow()
          + "): "
          + row.getRemaining()
          + " of "
          + row.getLimit()
          + " left");
}

Kotlin

val usage = client.getUsage().body
for (row in usage.allowance) {
    println("${row.feature} (${row.window}): ${row.remaining} of ${row.limit} left")
}

Ruby

usage = client.get_usage.value
usage.allowance.each { |row| puts "#{row.feature} (#{row.window}): #{row.remaining} of #{row.limit} left" }
puts "#{usage.ledger.calls} calls this month" if usage.ledger

PHP

foreach ($client->getUsage()->value->getAllowance() as $row) {
    echo $row->getFeature(), ': ', $row->getRemaining(), ' of ', $row->getLimit(), ' left this ', $row->getWindow(), "\n";
}

라이브러리가 더 편하신가요? 라이브러리 섹션을 보세요.

번역본과 영어 참조 문서의 내용이 다른 경우, 영어 참조 문서가 올바른 것으로 봅니다.