> ## 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.

# モデレーション使用量を取得

> 過去30日間の1日あたりの課金対象モデレーション画面数、未請求の画面数、および次回請求までに残っている画面数を取得します。



## OpenAPI

````yaml get /moderation/usage
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.116.1
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
  - name: Payment Connector Webhooks
  - name: Moderation
paths:
  /moderation/usage:
    get:
      tags:
        - Moderation
      summary: Get moderation usage
      description: >-
        Shows how many billable screens you made and how close you are to your
        next charge.


        **Billing.** A billable screen is a live-mode screen that returns a
        verdict. Dodo Payments charges

        $0.30 for each full block of 1000 billable screens and debits the fee
        from your balance.

        Each full block is charged within one hour. Screens that do not fill a
        block stay unbilled

        until they do. Errors and test-mode screens are free and are not
        counted.
      operationId: get_usage
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModerationUsageResponse'
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import DodoPayments from 'dodopayments';

            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.moderation.retrieveUsage();

            console.log(response.daily);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            response = client.moderation.retrieve_usage()
            print(response.daily)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tresponse, err := client.Moderation.GetUsage(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Daily)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import
            com.dodopayments.api.models.moderation.ModerationRetrieveUsageParams;

            import
            com.dodopayments.api.models.moderation.ModerationRetrieveUsageResponse;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    ModerationRetrieveUsageResponse response = client.moderation().retrieveUsage();
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import
            com.dodopayments.api.models.moderation.ModerationRetrieveUsageParams

            import
            com.dodopayments.api.models.moderation.ModerationRetrieveUsageResponse


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val response: ModerationRetrieveUsageResponse = client.moderation().retrieveUsage()
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )

            response = dodo_payments.moderation.retrieve_usage

            puts(response)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $response = $client->moderation->retrieveUsage();

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: |-
            using System;
            using DodoPayments.Client;
            using DodoPayments.Client.Models.Moderation;

            DodoPaymentsClient client = new();

            ModerationRetrieveUsageParams parameters = new();

            var response = await client.Moderation.RetrieveUsage(parameters);

            Console.WriteLine(response);
        - lang: Rust
          source: |-
            use dodopayments::Client;

            #[tokio::main]
            async fn main() -> dodopayments::Result<()> {
                let client = Client::from_env()?;
                let result = client
                    .moderation()
                    .retrieve_usage()
                    .await?;
                println!("{result:?}");
                Ok(())
            }
components:
  schemas:
    ModerationUsageResponse:
      type: object
      description: Your moderation usage.
      required:
        - unbilled_screens
        - screens_to_next_block
        - daily
      properties:
        daily:
          type: array
          items:
            $ref: '#/components/schemas/DailyScreens'
          description: >-
            Your billable screens per UTC day for the last 30 days, charged or
            not. A day with no

            screens is not in the list.
        screens_to_next_block:
          type: integer
          format: int64
          description: >-
            Billable screens still needed to fill the next block of 1000. A full
            block is charged

            within one hour, so this value is 1000 when your unbilled screens
            fill whole blocks.
        unbilled_screens:
          type: integer
          format: int64
          description: Billable screens that Dodo Payments has not charged for yet.
    DailyScreens:
      type: object
      required:
        - date
        - screens
      properties:
        date:
          type: string
          format: date
          description: The UTC day.
        screens:
          type: integer
          format: int64
          description: Billable screens on that day.
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````