사용량 요약 (크레딧)
GET
/api/v1/billing/usage
const url = 'https://dev.api.endueos.com/api/v1/billing/usage?project_id=prj_01J9ZK3Q8M4XW7D2N5R6T0V1BC&station_id=stn_01J9ZK3Q8M4XW7D2N5R6T0V1BC';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://dev.api.endueos.com/api/v1/billing/usage?project_id=prj_01J9ZK3Q8M4XW7D2N5R6T0V1BC&station_id=stn_01J9ZK3Q8M4XW7D2N5R6T0V1BC' \ --header 'Authorization: Bearer <token>'기간의 사용 요약. 기본은 최근 30일.
project_id 를 주면 그 프로젝트의 Station 들 것만 (없거나 남의 것이면 404 PROJECT_NOT_FOUND), station_id 를 주면 그 Station 것만 센다 — 둘 다 주면 둘 다 맞는 것.
파라미터
섹션 제목: “파라미터”쿼리 파라미터
섹션 제목: “쿼리 파라미터”from
string format: date-time
to
string format: date-time
project_id
프로젝트 — 조직 아래, Station 위 (D-51 · D-60).
string
예시
prj_01J9ZK3Q8M4XW7D2N5R6T0V1BCstation_id
string
예시
stn_01J9ZK3Q8M4XW7D2N5R6T0V1BC200
섹션 제목: “200”성공.
Media typeapplication/json
object
data
필수
계정의 사용 요약. project_id·station_id 로 걸렀으면 그 범위의 것이다.
object
from
필수
string format: date-time
to
필수
string format: date-time
total_credits
필수
기간 안의 사용 합계 (양수).
number format: double
by_metric
필수
Array<object>
object
metric
필수
string
quantity
필수
number format: double
credits
필수
number format: double
by_day
필수
날짜(UTC)순. 사용이 없는 날은 빠진다.
Array<object>
object
date
필수
string format: date
credits
필수
number format: double
meta
필수
object
request_id
필수
string
timestamp
필수
string format: date-time
duration
서버 처리 시간(ms).
integer format: int32
예시자동 생성
{ "data": { "from": "2026-04-15T12:00:00Z", "to": "2026-04-15T12:00:00Z", "total_credits": 1, "by_metric": [ { "metric": "example", "quantity": 1, "credits": 1 } ], "by_day": [ { "date": "2026-04-15", "credits": 1 } ] }, "meta": { "request_id": "example", "timestamp": "2026-04-15T12:00:00Z", "duration": 1 }}400
섹션 제목: “400”요청 형식이 틀렸다 — VALIDATION_ERROR(details.errors[]) 또는 BAD_REQUEST. 본문은 오류 봉투.
401
섹션 제목: “401”인증이 없거나 무효다 — UNAUTHORIZED. 본문은 오류 봉투.
403
섹션 제목: “403”이 인증 수단으로는 못 하는 일이다 — FORBIDDEN (예: API 키로 클라우드 기기 만들기). 본문은 오류 봉투.
404
섹션 제목: “404”없거나 내 것이 아니다 — *_NOT_FOUND. 본문은 오류 봉투.
429
섹션 제목: “429”한도를 넘었다 — Retry-After 초 뒤에 다시. 본문은 오류 봉투.
500
섹션 제목: “500”서버 오류 — INTERNAL_ERROR. 본문은 오류 봉투.
503
섹션 제목: “503”의존 서비스에 닿지 못했다 — 잠시 뒤 다시. 본문은 오류 봉투.