Upload a dataset version
Experimental: datasets’ operations, fields and limits can change between releases. An organization not enabled for fine-tuning receives 400 invalid_request on every dataset operation. Reads an uploaded JSONL file as the dataset’s next version and answers 201 with the ready version, built before the call returns. The file is checked whole before the version is created: any rejected line answers 400 with details.lineErrors (at most 100, each with line and error) and creates no version; an unknown fileId answers 400 on fileId. A stale baseVersion, or a version already being built for the dataset, answers 409 conflict; a build whose uploader has written nothing for the build lease (30 minutes by default) is taken over by the next upload, and its own uploader then answers 409. A file that changes nothing creates no version: the 201 carries the current version and its Location. Server-owned fields (rowId once stored, source, reward) must come back unchanged; an edit that changes a row’s messages drops its reward. The agentId, agentVersionId and environmentId of a new or changed row must name a live agent version and environment of the organization; a row the file leaves unchanged is not checked again. Idempotency-Key is required.
Authorizations
Headers
Replay-protection key scoped to the verified tenant, organization, principal, this operation and the dataset: the same key from another caller, for another operation or for another dataset is a new request. It must contain 1 to 256 visible ASCII characters and be sent as exactly one header value. Request identity is the exact HTTP method, escaped path, raw query, and raw body bytes. The same request replays the original successful response; any different request returns 409 idempotency_conflict, and an active matching request returns 409 idempotency_in_progress. Completed receipts are retained for approximately 24 hours, pending claims may be reclaimed after approximately 1 hour, and no deduplication is guaranteed after expiry.
1 - 256^[!-~]+$Body
A JSONL file uploaded with the files API: one row per line, each line a row object. A row has messages (required; each with role system, user, assistant or tool, content, and for an assistant turn toolCalls and an optional model, for a tool turn toolCallId), tools (name and inputSchema), graders (each {key, kind}: kind code takes exactly one of checks, each check with a required key unique within the row, or run {argv, fileIds}; kind agent takes criteria [{key, text}]), fileIds (ids of the organization files an episode opens with; not resolved by the upload), split (train or held_out; a row without one keeps its stored split, and a new row goes to held_out when a hash of its rowId says so, about 1 row in 10, otherwise to train; only train rows count toward sftReady), agentId, agentVersionId and environmentId (all three or none), and the server-owned rowId, source and reward ({components}). Integers inside tool schemas and call arguments stay within +-9007199254740991, or are written exactly as JavaScript prints their double (such as 9007199254740992 or 1e+21); other integer-valued spellings beyond that range (1e16, 9007199254740993), and fractions that round to an integer or infinity, are refused; a check's min, max and minutes stay within +-9007199254740991. The file is the whole content of the new version: rows are matched to the base version by rowId (a row without one is identified by its content), a row that differs replaces its predecessor, and a row the file leaves out is removed. A file with no rows is refused, so remove every row with managedAgentsRemoveDatasetRows. At most 64 MiB, 50,000 rows, 10,000 regex checks and 1 MiB of regex patterns in the file; a row has at most 5 regex checks and the file at most 16 distinct regex patterns, each a pattern of at most 128 characters that compiles to at most 1,000 instructions. The upload compiles each regex to validate it and does not run it.
Response
Created