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

# Call 完了

> 完了済みの Call のバッチを `calls_complete` 表に直接アップサートします。

バッチ内の各 Call には、開始情報と終了情報の両方が含まれます。
このエンドポイントは、Call がクライアント側でバッファされ、完了レコードとして送信される場合に使用されます。



## OpenAPI

````yaml /ja/weave/reference/service-api/openapi.json post /v2/{entity}/{project}/calls/complete
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /v2/{entity}/{project}/calls/complete:
    post:
      tags:
        - Calls
      summary: Call 完了
      description: |-
        完了済みの Call のバッチを `calls_complete` 表に直接アップサートします。

        バッチ内の各 Call には、開始情報と終了情報の両方が含まれます。
        このエンドポイントは、Call がクライアント側でバッファされ、完了レコードとして送信される場合に使用されます。
      operationId: calls_complete_v2__entity___project__calls_complete_post
      parameters:
        - in: path
          name: entity
          required: true
          schema:
            title: Entity
            type: string
        - in: path
          name: project
          required: true
          schema:
            title: Project
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallsUpsertCompleteReq'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallsUpsertCompleteRes'
          description: 正常なレスポンス
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: 検証エラー
components:
  schemas:
    CallsUpsertCompleteReq:
      description: 完了済みの Call のバッチをアップサートするためのリクエストです。
      properties:
        batch:
          items:
            $ref: '#/components/schemas/CompletedCallSchemaForInsert'
          title: Batch
          type: array
      required:
        - batch
      title: CallsUpsertCompleteReq
      type: object
    CallsUpsertCompleteRes:
      description: 完了済みの Call のバッチをアップサートするためのレスポンスです。
      properties: {}
      title: CallsUpsertCompleteRes
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CompletedCallSchemaForInsert:
      description: >-
        完了済みの Call を直接挿入するためのスキーマです。


        これは、挿入時点ですでに完了している Call を表し、開始情報と終了情報の両方がまとめて提供されます。calls_complete
        エンドポイントで使用されます。
      properties:
        attributes:
          additionalProperties: true
          title: Attributes
          type: object
        display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Name
        ended_at:
          format: date-time
          title: Ended At
          type: string
        exception:
          anyOf:
            - type: string
            - type: 'null'
          title: Exception
        id:
          title: Id
          type: string
        inputs:
          additionalProperties: true
          title: Inputs
          type: object
        op_name:
          title: Op Name
          type: string
        otel_dump:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Otel Dump
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Id
        project_id:
          title: Project Id
          type: string
        started_at:
          format: date-time
          title: Started At
          type: string
        summary:
          $ref: '#/components/schemas/SummaryInsertMap'
        thread_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Thread Id
        trace_id:
          title: Trace Id
          type: string
        turn_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Turn Id
        wb_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Wb Run Id
        wb_run_step:
          anyOf:
            - type: integer
            - type: 'null'
          title: Wb Run Step
        wb_run_step_end:
          anyOf:
            - type: integer
            - type: 'null'
          title: Wb Run Step End
        wb_user_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 直接設定しないでください。サーバーがこのフィールドを自動的に設定します。
          title: Wb User Id
      required:
        - project_id
        - id
        - trace_id
        - op_name
        - started_at
        - ended_at
        - attributes
        - inputs
        - summary
      title: CompletedCallSchemaForInsert
      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
    SummaryInsertMap:
      additionalProperties: true
      properties:
        status_counts:
          additionalProperties:
            type: integer
          propertyNames:
            $ref: '#/components/schemas/TraceStatus'
          title: Status Counts
          type: object
        usage:
          additionalProperties:
            $ref: '#/components/schemas/LLMUsageSchema'
          title: Usage
          type: object
      title: SummaryInsertMap
      type: object
    LLMUsageSchema:
      additionalProperties: true
      properties:
        cache_creation_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Creation Input Tokens
        cache_read_input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Read Input Tokens
        completion_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Completion Tokens
        input_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Input Tokens
        output_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Output Tokens
        prompt_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Prompt Tokens
        requests:
          anyOf:
            - type: integer
            - type: 'null'
          title: Requests
        total_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: Total Tokens
      title: LLMUsageSchema
      type: object

````