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

# calls 使用量

> 子孫 call を含めて集計し、複数のルート call の集約使用量を計算します。



## OpenAPI

````yaml /ja/weave/reference/service-api/openapi.json post /calls/usage
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /calls/usage:
    post:
      tags:
        - Calls
      summary: calls 使用量
      description: 子孫 call を含めて集計し、複数のルート call の集約使用量を計算します。
      operationId: calls_usage_calls_usage_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallsUsageReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallsUsageRes'
          description: 成功レスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
components:
  schemas:
    CallsUsageReq:
      additionalProperties: false
      description: >-
        複数のルート call の集計された使用状況を計算するリクエスト。


        この Endpoint は、リクエストされた各ルート call
        の使用状況メトリクスを返します。各ルートのメトリクスには、そのルート自身の使用状況の合計に加えて、すべての子孫の使用状況の合計も含まれます。


        注: 集計のために、条件に一致するすべての call がメモリに読み込まれます。結果セットが非常に大きい場合（>10k calls）は、ルート
        call ID をバッチ処理するか、application レイヤーでより限定的なフィルターを使用することを検討してください。
      properties:
        call_ids:
          description: 集計するルート call ID。各結果キーは、それぞれ 1 つの入力 call ID に対応します。
          items:
            type: string
          title: Call Ids
          type: array
        include_costs:
          default: false
          description: true の場合、使用状況にコスト計算を含めます。
          title: Include Costs
          type: boolean
        limit:
          default: 10000
          description: すべてのトレースにわたって処理する call の最大数。メモリ使用量が際限なく増えるのを防ぐための安全上限として機能します。
          title: Limit
          type: integer
        project_id:
          title: Project Id
          type: string
      required:
        - project_id
        - call_ids
      title: CallsUsageReq
      type: object
    CallsUsageRes:
      description: ルート call ごとの集計された使用状況メトリクスを含むレスポンス。
      properties:
        call_usage:
          additionalProperties:
            additionalProperties:
              $ref: '#/components/schemas/LLMAggregatedUsage'
            type: object
          title: Call Usage
          type: object
        unfinished_call_ids:
          items:
            type: string
          title: Unfinished Call Ids
          type: array
      title: CallsUsageRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    LLMAggregatedUsage:
      description: 特定の LLM について集計された使用状況メトリクス。
      properties:
        cache_creation_input_tokens:
          default: 0
          title: Cache Creation Input Tokens
          type: integer
        cache_creation_input_tokens_total_cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cache Creation Input Tokens Total Cost
        cache_read_input_tokens:
          default: 0
          title: Cache Read Input Tokens
          type: integer
        cache_read_input_tokens_total_cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Cache Read Input Tokens Total Cost
        completion_tokens:
          default: 0
          title: Completion Tokens
          type: integer
        completion_tokens_total_cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Completion Tokens Total Cost
        prompt_tokens:
          default: 0
          title: Prompt Tokens
          type: integer
        prompt_tokens_total_cost:
          anyOf:
            - type: number
            - type: 'null'
          title: Prompt Tokens Total Cost
        requests:
          default: 0
          title: Requests
          type: integer
        total_tokens:
          default: 0
          title: Total Tokens
          type: integer
      title: LLMAggregatedUsage
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````