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

# 사용량 기반 청구

> 고객이 실제로 사용하는 것에 따라 요금을 부과하며 유연한 계량 및 자동 청구를 제공합니다.

사용량 기반 청구를 통해 고객이 실제로 사용하는 것에 대해 요금을 부과할 수 있습니다—API 호출, 저장소, AI 토큰 또는 정의한 모든 메트릭에 대해. 고객은 고정 요금이 아닌 소비에 대해 지불합니다.

<Info>
  **다음에 적합**: API, AI 서비스, 인프라 플랫폼 및 사용량에 따라 가치가 확장되는 모든 제품.
</Info>

## 작동 방식

<Steps>
  <Step title="Send Usage Events">
    청구 가능한 작업이 발생할 때 애플리케이션에서 이벤트를 보냅니다.

    ```javascript theme={null}
    {
      "event_id": "evt_123",
      "customer_id": "cus_abc",
      "event_name": "api.call",
      "metadata": { "endpoint": "/v1/users" }
    }
    ```
  </Step>

  <Step title="Meters Aggregate Usage">
    미터는 Count, Sum, Max 또는 Last 집계를 사용하여 이벤트를 청구 가능한 수량으로 집계합니다.
  </Step>

  <Step title="Automatic Billing">
    단위당 가격과 무료 한도를 설정합니다. 고객에게는 매 사이클 자동으로 청구됩니다.
  </Step>
</Steps>

## 핵심 개념

### 이벤트

이벤트는 애플리케이션의 사용 작업을 나타냅니다. 각 이벤트에는 다음이 포함됩니다:

* **이벤트 이름**: 사용 유형 (예: `api.call`)
* **고객 ID**: 사용한 사람
* **메타데이터**: 집계를 위한 추가 속성

### 계량기

계량기는 이벤트를 청구 가능한 수량으로 집계합니다:

* **Count**: 총 이벤트 (API 호출)
* **Sum**: 값 추가 (총 바이트)
* **Max**: 최고 값 (최대 사용자 수)
* **Last**: 가장 최근 값

<Frame>
  <img src="https://mintcdn.com/dodopayments/w9oVTi6CzZMAOQA3/images/usage-based/UBB-2.png?fit=max&auto=format&n=w9oVTi6CzZMAOQA3&q=85&s=f9d85a463fba231437151db3d4a2052a" alt="미터 인터페이스 생성" style={{ maxHeight: '500px', width: 'auto' }} width="2324" height="1600" data-path="images/usage-based/UBB-2.png" />
</Frame>

### 사용량 가격 책정이 있는 제품

단위당 가격과 선택적 무료 한도를 설정합니다:

<Frame>
  <img src="https://mintcdn.com/dodopayments/w9oVTi6CzZMAOQA3/images/usage-based/UBB-4.png?fit=max&auto=format&n=w9oVTi6CzZMAOQA3&q=85&s=b2d07bb408fd79e1b788c1b7092b8bca" alt="가격 구성" style={{ maxHeight: '500px', width: 'auto' }} width="732" height="712" data-path="images/usage-based/UBB-4.png" />
</Frame>

**예시**: 2,500 호출 - 1,000 무료 = 1,500 × $0.02 = $30.00

### 크레딧 기반 차감

단위당 달러로 청구하는 대신, 미터를 구성하여 고객의 [크레딧 잔액](/features/credit-based-billing)에서 차감하도록 설정할 수 있습니다. 크레딧은 각 청구 주기마다 새로 고쳐지며 초과 요금이 적용되기 전에 사용됩니다.

## 빠른 시작

<Steps>
  <Step title="Create a Meter">
    대시보드에서: **Meters** → **Create Meter**

    1. 이벤트 이름 설정 (예: `api.call`)
    2. 집계 선택 (Count, Sum, Max, Last)
    3. 선택적 필터 추가
  </Step>

  <Step title="Add to Product">
    제품에 가격을 포함한 미터 연결:

    <Frame>
      <img src="https://mintcdn.com/dodopayments/w9oVTi6CzZMAOQA3/images/usage-based/UBB-5.png?fit=max&auto=format&n=w9oVTi6CzZMAOQA3&q=85&s=fd3851a1a070714baf0aec01cff717b8" alt="제품에 미터 추가" style={{ maxHeight: '500px', width: 'auto' }} width="2272" height="1422" data-path="images/usage-based/UBB-5.png" />
    </Frame>

    1. **사용량 기반 청구** 선택
    2. 미터 선택
    3. 단위당 가격과 무료 한도 설정
  </Step>

  <Step title="Send Events">
    ```javascript theme={null}
    await fetch('https://test.dodopayments.com/events/ingest', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${process.env.DODO_PAYMENTS_API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        events: [{
          event_id: "unique_event_id",
          customer_id: "cus_abc123",
          event_name: "api.call",
          metadata: { endpoint: "/v1/users" }
        }]
      })
    });
    ```
  </Step>

  <Step title="Monitor Usage">
    <Frame>
      <img src="https://mintcdn.com/dodopayments/16r81mgDWvSgYER7/images/guides/usage-based-billing/meter-quantities-chart.png?fit=max&auto=format&n=16r81mgDWvSgYER7&q=85&s=1a8a39547bd0259a53d4591d7928c8ea" alt="미터 대시보드" style={{ maxHeight: '500px', width: 'auto' }} width="1602" height="888" data-path="images/guides/usage-based-billing/meter-quantities-chart.png" />
    </Frame>

    미터 대시보드에서 이벤트 및 사용량 집계를 확인하세요. 고객에게는 매 사이클 자동으로 청구됩니다.
  </Step>
</Steps>

## 사용 사례

<CardGroup cols={2}>
  <Card title="APIs & Infrastructure" icon="cloud">
    API 호출, 연산 시간, 대역폭, 스토리지를 추적합니다. 예: 무료 10,000회 이후 호출당 \$0.001.
  </Card>

  <Card title="AI Usage Tracking" icon="brain">
    토큰, 생성, 처리 시간을 추적합니다. 예: 표준 이미지는 \$0.04, HD는 \$0.08.
  </Card>

  <Card title="Data & Analytics" icon="chart-line">
    처리한 데이터, 실행한 쿼리, 분석한 레코드로 청구합니다. 예: 무료 10GB 이후 GB당 \$5.
  </Card>

  <Card title="Communication" icon="message">
    메시지 수, 분, 전송된 데이터량을 계산합니다. 예: 전송된 SMS당 \$0.01.
  </Card>
</CardGroup>

## 다음 단계

<CardGroup cols={2}>
  <Card title="Event Ingestion" icon="bolt" href="/features/usage-based-billing/event-ingestion">
    애플리케이션에서 사용 이벤트를 구성하고 전송하는 방법을 알아보세요.
  </Card>

  <Card title="Meters Guide" icon="sliders" href="/features/usage-based-billing/meters">
    미터 구성, 집계 유형 및 이벤트 필터링을 숙달하세요.
  </Card>

  <Card title="Complete Tutorial" icon="code" href="/developer-resources/usage-based-billing-build-ai-image-generator">
    사용량 기반 청구를 사용하여 AI 이미지 생성기를 처음부터 구축하세요.
  </Card>

  <Card title="Integration Guide" icon="book" href="/developer-resources/usage-based-billing-guide">
    애플리케이션에 사용량 기반 청구를 구현하는 종합 가이드입니다.
  </Card>
</CardGroup>
