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

# データセットのエントリを追加または置換する

> 1 回のトランザクションで最大 5,000 行の OpenAI チャットデータを書き込みます。JSON 配列、または同じデータを NDJSON（1 行につき 1 レコード）形式で、`Content-Type: application/x-ndjson` を指定して送信します。無効な行が 1 つでもあるとリクエストは拒否され、その行のインデックスが報告されます。NDJSON の N 行目のインデックスは N - 1 です。`mode=append` は既存の `row_id` を拒否します（409 `entry_exists`）。`mode=upsert` は既存の行を置き換えますが、行で省略された `group_id`、`split`、`metadata`、`provenance` については保存済みの値を保持します。新しいエントリはデフォルトで `train` に割り当てられ、それぞれ個別のグループに属します。1 つのグループが複数の分割にまたがる書き込みは、409 `group_split_conflict` を返します。書き込みによってデータセットは新しいリビジョンに更新され、完了済みのリラベルと評価は最新ではない状態としてマークされます。



## OpenAPI

````yaml ja/openapi/model-distillation/management.openapi.yaml POST /projects/{alias}/datasets/{datasetId}/entries
openapi: 3.1.0
info:
  title: CoreWeave Model Distillation Management API
  version: 1.0.0
  description: |
    プロバイダー、project、ルーティングバージョン、データセット、再ラベル付け、
    ファインチューン、評価、Analyticsを管理します。これは
    Model Distillationでも使用されるAPIです。
servers:
  - url: https://forge.coreweave.com/api/distillation/v1
    description: 本番
security:
  - WandbCredential: []
tags:
  - name: Providers
    description: OpenAI互換エンドポイント、認証情報、モデルカタログ、料金。
  - name: Projects
    description: 安定したprojectアイデンティティとprojectレベルの情報。
  - name: Routing
    description: バージョン管理されたモデルターゲット、重み、リクエストパラメーター。
  - name: Datasets
    description: 再現可能なデータスナップショット、エントリ、再ラベル付け、再利用可能なモデル出力。
  - name: Fine-tunes
    description: 教師ありファインチューニングジョブとホスト型モデル アーティファクト。
  - name: Evaluations
    description: ヘッドツーヘッド、完全一致、分類の評価。
  - name: Analytics
    description: project トラフィック、トークン、エラー、推定コストの読み取りモデル。
  - name: UI preferences
    description: UIで使用されるprojectごとの表示設定。
paths:
  /projects/{alias}/datasets/{datasetId}/entries:
    parameters:
      - $ref: '#/components/parameters/WandbEntity'
      - $ref: '#/components/parameters/ProjectAlias'
      - $ref: '#/components/parameters/DatasetId'
    post:
      tags:
        - Datasets
      summary: データセットのエントリを追加または置換
      description: >-
        1 回のトランザクションで最大 5,000 行の OpenAI チャットデータを書き込みます。JSON 配列、または同じデータを
        NDJSON（1 行につき 1 レコード）形式で、`Content-Type: application/x-ndjson`
        を指定して送信します。無効な行が 1 つでもあるとリクエストは拒否され、その行のインデックスが報告されます。NDJSON の N
        行目のインデックスは N - 1 です。`mode=append` は既存の `row_id` を拒否します（409
        `entry_exists`）。`mode=upsert` は既存の行を置き換えますが、行で省略された
        `group_id`、`split`、`metadata`、`provenance`
        については保存済みの値を保持します。新しいエントリはデフォルトで `train` に割り当てられ、それぞれ個別のグループに属します。1
        つのグループが複数の分割にまたがる書き込みは、409 `group_split_conflict`
        を返します。書き込みによってデータセットは新しいリビジョンに更新され、完了済みのリラベルと評価は最新ではない状態としてマークされます。
      operationId: writeDatasetEntries
      parameters:
        - name: mode
          in: query
          description: append は row_id がすでに存在する行を拒否し、upsert はその行を置き換えます。
          required: false
          schema:
            default: append
            type: string
            enum:
              - append
              - upsert
        - name: dry_run
          in: query
          description: 変更を検証して報告し、その後ロールバックします。
          required: false
          schema:
            type: boolean
            default: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              minItems: 1
              maxItems: 5000
              type: array
              items:
                type: object
                properties:
                  row_id:
                    description: >-
                      データセット内で変わらない識別子です。アップサート時はこの識別子で照合します。デフォルトはメッセージとリクエストフィールドのダイジェストです。
                    type: string
                    minLength: 1
                    maxLength: 512
                  group_id:
                    description: 1 つの会話の各ターンなど、同じ分割に属する必要がある行をまとめます。デフォルトは row_id です。
                    type: string
                    minLength: 1
                    maxLength: 512
                  split:
                    description: >-
                      train を指定するか、評価用に行をトレーニングから除外する場合は val を指定します。新しい行のデフォルトは
                      train です。
                    type: string
                    enum:
                      - train
                      - val
                  messages:
                    minItems: 2
                    maxItems: 1000
                    type: array
                    items:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                  tools:
                    maxItems: 128
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          const: function
                        function:
                          type: object
                          properties:
                            name:
                              type: string
                              minLength: 1
                              maxLength: 256
                            description:
                              type: string
                              maxLength: 16384
                            parameters:
                              type: object
                              propertyNames:
                                type: string
                              additionalProperties: {}
                            strict:
                              type: boolean
                          required:
                            - name
                          additionalProperties: false
                      required:
                        - type
                        - function
                      additionalProperties: false
                  tool_choice: {}
                  response_format: {}
                  metadata:
                    description: ユーザーや顧客セグメントなど、フィルターに使用できる属性です。
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  provenance:
                    description: ソースシステムやトレース ID など、行の出所を示す情報です。
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                required:
                  - messages
                additionalProperties: false
          application/x-ndjson:
            schema:
              type: string
              description: JSON 配列の各要素と同じ形式で、1 行につき 1 つの JSON レコードを指定します。
      responses:
        '200':
          description: エントリが書き込まれました。ドライランの場合は、実際に実行した場合に書き込まれるエントリを示します。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetEntryWriteResult'
        default:
          $ref: '#/components/responses/Error'
components:
  parameters:
    WandbEntity:
      name: Wandb-Entity
      in: header
      required: false
      description: アクセス可能な個人またはチーム entity。省略すると、認証済みユーザーのデフォルトの entity を使用します。
      schema:
        type: string
    ProjectAlias:
      name: alias
      in: path
      required: true
      schema:
        type: string
        pattern: ^[a-z0-9-]{1,64}$
    DatasetId:
      name: datasetId
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    DatasetEntryWriteResult:
      type: object
      required:
        - dry_run
        - created
        - updated
        - revision
        - entry_counts
        - group_conflicts
      properties:
        dry_run:
          type: boolean
        created:
          type: integer
          description: 新しいエントリとして追加された行。
        updated:
          type: integer
          description: 行によって置き換えられた既存のエントリ。
        revision:
          type: integer
          description: 書き込み後のデータセットのリビジョン。ドライランでは変更されません。
        entry_counts:
          $ref: '#/components/schemas/DatasetEntryCounts'
        group_conflicts:
          type: array
          items:
            type: string
          description: 複数の分割にまたがるグループ。競合がある場合、実際の書き込みは拒否されます。
    DatasetEntryCounts:
      type: object
      required:
        - total
        - train
        - val
      properties:
        total:
          type: integer
        train:
          type: integer
        val:
          type: integer
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
      example:
        error:
          message: Project 'missing' not found in entity 'your-team'
          type: not_found
  responses:
    Error:
      description: リクエストが失敗しました。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    WandbCredential:
      type: http
      scheme: bearer
      bearerFormat: wandb API key or JWT
      description: >-
        wandb APIキーまたは wandb JWT。ブラウザーセッションの交換は、Model Distillation
        ウェブアプリのバックエンドで行われます。ジョブのケイパビリティは内部専用です。

````