> ## Documentation Index
> Fetch the complete documentation index at: https://studio-docs.thezet.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 사용량 조회

> API로 만든 작업의 수와 금액을 기간별로 묶어 줘요. 날짜는 UTC 기준이고, 작업을 시작한 날로 세요. 사이트에서 만든 작업은 들어가지 않아요.



## OpenAPI

````yaml /openapi.json get /usage
openapi: 3.1.0
info:
  title: Zet Studio API
  version: 1.0.0
  description: 이미지와 영상을 만드는 API예요. 작업을 시작하고, 끝날 때까지 조회한 뒤, 결과를 받아요.
servers:
  - url: https://api.studio.thezet.io/v1
security: []
tags:
  - name: 모델과 가격
  - name: 생성
  - name: 입력 파일
  - name: 계정
  - name: 웹훅
paths:
  /usage:
    get:
      tags:
        - 계정
      summary: 사용량 조회
      description: >-
        API로 만든 작업의 수와 금액을 기간별로 묶어 줘요. 날짜는 UTC 기준이고, 작업을 시작한 날로 세요. 사이트에서 만든 작업은
        들어가지 않아요.
      operationId: getUsage
      parameters:
        - name: from
          in: query
          required: false
          description: 시작 날짜예요. 이날을 포함해요. 기본은 `to`가 속한 달의 1일이에요.
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: false
          description: 끝 날짜예요. 이날을 포함해요. 기본은 오늘이에요. 기간은 366일까지예요.
          schema:
            type: string
            format: date
        - name: group_by
          in: query
          required: false
          description: 묶는 기준이에요.
          schema:
            type: string
            enum:
              - day
              - model
              - api_key
            default: day
        - name: Accept-Language
          in: header
          required: false
          description: '`ko`면 메시지를 한국어로 줘요. 기본은 영어예요.'
          schema:
            type: string
      responses:
        '200':
          description: 사용량이에요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Usage'
        '400':
          description: 요청 내용이 잘못됐어요. `details`에 항목별 문제가 있어요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: API 키가 없거나 잘못됐어요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: 이 계정은 아직 API 사용이 승인되지 않았어요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: 호출 한도나 동시 실행 한도를 넘었어요. `retry_after_seconds`만큼 기다린 뒤 다시 보내요.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    Usage:
      $id: '#/components/schemas/Usage'
      type: object
      properties:
        from:
          type: string
          format: date
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
          description: 시작 날짜예요. UTC 기준이고, 이날을 포함해요.
        to:
          type: string
          format: date
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
          description: 끝 날짜예요. UTC 기준이고, 이날을 포함해요.
        group_by:
          type: string
          enum:
            - day
            - model
            - api_key
        totals:
          type: object
          properties:
            generations:
              type: number
              description: 이 기간에 시작한 작업 수예요.
            succeeded:
              type: number
            failed:
              type: number
            canceled:
              type: number
            active:
              type: number
              description: 아직 끝나지 않은 작업 수예요.
            spent_usd:
              type: string
              pattern: ^\d+\.\d{4}$
              description: 성공한 작업에 청구된 금액이에요.
            held_usd:
              type: string
              pattern: ^\d+\.\d{4}$
              description: 진행 중인 작업에 묶인 금액이에요. 끝나면 청구되거나 돌아가요.
          required:
            - generations
            - succeeded
            - failed
            - canceled
            - active
            - spent_usd
            - held_usd
          additionalProperties: false
        rows:
          type: array
          items:
            type: object
            properties:
              group:
                description: 날짜, 모델 ID, API 키 ID, 또는 연결된 앱의 ID예요.
                type:
                  - string
                  - 'null'
              name:
                description: 모델, API 키, 또는 연결된 앱의 이름이에요. 날짜별로 묶으면 null이에요.
                type:
                  - string
                  - 'null'
              generations:
                type: number
                description: 이 기간에 시작한 작업 수예요.
              succeeded:
                type: number
              failed:
                type: number
              canceled:
                type: number
              active:
                type: number
                description: 아직 끝나지 않은 작업 수예요.
              spent_usd:
                type: string
                pattern: ^\d+\.\d{4}$
                description: 성공한 작업에 청구된 금액이에요.
              held_usd:
                type: string
                pattern: ^\d+\.\d{4}$
                description: 진행 중인 작업에 묶인 금액이에요. 끝나면 청구되거나 돌아가요.
            required:
              - group
              - name
              - generations
              - succeeded
              - failed
              - canceled
              - active
              - spent_usd
              - held_usd
            additionalProperties: false
      required:
        - from
        - to
        - group_by
        - totals
        - rows
      additionalProperties: false
    Error:
      $id: '#/components/schemas/Error'
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: 프로그램에서 구분할 때 쓰는 값이에요.
            message:
              type: string
              description: '사람이 읽는 설명이에요. 기본은 영어이고 `Accept-Language: ko`면 한국어예요.'
            request_id:
              description: 문의할 때 알려 주세요.
              type:
                - string
                - 'null'
            details:
              description: 항목별 문제처럼 더 자세한 내용이에요. 없으면 null이에요.
            retryable:
              type: boolean
              description: 같은 요청을 다시 보내도 되는지 알려줘요.
            retry_after_seconds:
              description: 이만큼 기다린 뒤 다시 보내요. 없으면 null이에요.
              type:
                - number
                - 'null'
          required:
            - code
            - message
            - request_id
            - details
            - retryable
            - retry_after_seconds
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: zet_live_...
      description: '`Authorization: Bearer <API 키>`'
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: '`x-api-key: <API 키>`. 둘 중 하나만 보내요.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.