> ## Documentation Index
> Fetch the complete documentation index at: https://weights.fyi/run/llms.txt

# POST /v1/datasets

```text
POST https://weights.fyi/run/v1/datasets
Authorization: Bearer <token>                    scope: submit
Content-Type: application/json

{"name": "<your name for it>"[, "format": "laya-sft-chat/jsonl"][, "base_model": "fastino-glide-28b"][, "source_ref": {...}]}
```

**Available since:** 2026-10-08, with fine-tuning. Implemented 2026-10-09: credit needed, storage reserved and limited. Zero-copy `source_ref` pointers and generative SFT/DPO/multi-head specialist formats added 2026-10-25 / 2026-11-02.

**Answer time:** synchronous: the dataset is made and described in the answer at once. With `source_ref` (zero-copy pointer to your bucket), the dataset is `ready` immediately in the `201 Created` response; without `source_ref`, the file goes to the address in the answer with [PUT /v1/datasets/{dataset_id}/content](/run/docs/reference/datasets-upload.md).

Registers a training dataset either as a zero-copy pointer (`source_ref`, recommended for large releases) or as a managed upload: with `source_ref`, zero bytes are uploaded to `weights.fyi`, the dataset is created in status `ready` immediately, and trainers stream `<prefix>manifest.json` + `<prefix>dataset.jsonl` directly from your bucket; without `source_ref`, the call makes an empty dataset in status `uploading` and returns `upload.path` (`/run/v1/datasets/<dataset_id>/content`) for [PUT /v1/datasets/{dataset_id}/content](/run/docs/reference/datasets-upload.md), [before training on it](/run/docs/reference/jobs-create-finetune.md). Fine-tuning is switched on for this service. While it is not, the call answers `404 not_configured` after checking your body.

A dataset costs nothing and is kept until you [delete it](/run/docs/reference/datasets-delete.md); its rows never appear in a log, trace or answer. Since the merge of 2026-10-09 making an uploaded dataset needs available credit above zero, and reserves 440 MiB until its upload sets its real size (zero-copy `source_ref` datasets reserve `0` managed bytes), against 8 datasets and 2,048 MiB per account and 128 and 20,480 MiB for the service.

## Request

| Name | Where | Required | Meaning |
|---|---|---|---|
| `Authorization` | header | yes | `Bearer` and your token. The token needs the `submit` scope, and the call counts against the token's request rate. |
| `Content-Type` | header | yes | `application/json`. The body may be at most 65,536 bytes. |
| `name` | body | yes | Your name for the dataset, any text that is not empty. It is shown back in every view of the dataset and is not used for anything else. |
| `format` | body | no | `laya-page-role/jsonl` (default, single-label `label`), `laya-sft-chat/jsonl` (alias `laya-student-sft/v1`, chat `messages`), `laya-dpo-preference/jsonl` (alias `laya-student-dpo/v1`, `prompt`/`chosen`/`rejected`), or `laya-specialist-heads/jsonl` (aliases `laya-specialist/jsonl`, `laya-specialist/v1`, `text`/`targets`). |
| `base_model` | body | no | Trainable base model ID or upstream Hugging Face alias (default `laya-page-role-base`; `model` is read the same way): `laya-page-role-base` (`laya-page-role`), `qwen3-4b`, `qwen3-8b`, `qwen3.5-4b`, `qwen3.5-8b`, `gemma3-27b`, `fastino-glide-28b` (`fastino/GLiDE`), `knowline-4b-gen5.5` (`PelaAI/KnowLine-4B-Gen5.5`), `knowline-35b-a3b-gen1.5` (`PelaAI/KnowLine-35B-A3B-Gen1.5`), `elephant-1-9b` (`baselabs/elephant-1`), `mammoth-1-27b` (`baselabs/mammoth-1`), `onejev-1.6-4b` (`OmniJev/OneJev1.6-4B`), `onejev-1.6-0.8b` (`OmniJev/OneJev1.6-0.8B`), `gliclass-v4-edge` (`knowledgator/gliclass-v4-edge`), `amber-0.4b` (`MLukauskas/amber-0.4b`). |
| `source_ref` | body | no | Zero-copy pointer object: `{"manifest_uri": "s3://...", "sha256": "<64-hex>", "row_count": <int>, "byte_size": <int>, "compression": "none", "train_rows": <int>, "validation_rows": <int>}` (where `compression` is `"none"`, `"zstd"`, or `"gzip"`). When supplied, the dataset is created in status `ready` immediately with `upload: null`. |

## Return value

**201 Created** with the dataset and the upload instruction, and `Location`, `/run/v1/datasets/<dataset_id>`.

| Field | Meaning |
|---|---|
| `dataset_id` | The dataset's identifier, `ds_` followed by 24 hexadecimal characters. Every other call about this dataset takes it. |
| `name` | The name you gave, with leading and trailing spaces removed. |
| `format` | The file format the upload will be read as, `laya-page-role/jsonl`. |
| `base_model` | The model this dataset trains, `laya-page-role-base`. |
| `labels` | The labels a line may carry, in the base model's own order. A line with any other label is refused at upload. |
| `status` | `uploading` in this answer. It becomes `ready` when a file has been accepted, `failed` when an upload was refused, and `deleted` after a delete. |
| `error` | The code of the last refused upload, or `null`. It is `null` in this answer. |
| `rows`, `train_rows`, `validation_rows` | How many lines the file holds in all, and how many of them are in each split. They are `null` until a file has been accepted. |
| `bytes` | The size of the accepted file in bytes, or `null` until then. |
| `sha256` | The SHA-256 of the accepted file, so you can check that what arrived is what you sent, or `null` until then. |
| `created_at` | When the dataset was made. |
| `ready_at` | When its file was accepted, or `null` until then. |
| `jobs` | The training jobs that have used this dataset, oldest first. It is empty in this answer. |
| `upload.method` | The method to send the file with, `PUT`. |
| `upload.path` | The path to send the file to, with the service's base path, `/run/v1/datasets/<dataset_id>/content`. |
| `upload.content_type` | The content type to send, `application/x-ndjson`. |
| `upload.max_bytes` | The largest file the upload accepts, in bytes; today 440 MiB. |
| `upload.row` | One sentence that names the fields each line of the file must hold. |

## Errors

| Status | Code | When it happens | What to do |
|---|---|---|---|
| `400` | `invalid_json`, `invalid_body` | The body is not a JSON object, or it has no `name`; `expected` shows the shape. | Send `{"name": "..."}`. |
| `400` | `unsupported_format` | The `format` is not one the service reads; `supported` lists the one it does. | Leave `format` out, or send `laya-page-role/jsonl`. |
| `400` | `model_not_available` | The base model is not one you can train; `trainable` lists the one you can. | Leave it out, or send `laya-page-role-base`. |
| `401` | `unauthorized`, `invalid_token`, `token_revoked`, `token_expired` | No token, or one that does not work (any more). | Use a valid token. |
| `403` | `scope_required`, `account_suspended` | The token lacks `submit`, or the account is suspended. | Use a token with `submit`. |
| `404` | `not_configured` | Fine-tuning is not switched on for this service (`feature` is `training`). | Nothing to fix on your side; see [Fine-tune a model](/run/docs/fine-tune.md). |
| `413` | `body_too_large` | The body is larger than the limit in `limit_bytes`. | The body only names the dataset; the file goes with the upload. |
| `429` | `rate_limited` | The token sends work faster than its request rate. | Wait the `Retry-After` seconds and send again. |
| `402` | `no_credit` | Your available credit is zero or less (merged 2026-10-09). | Add credit. |
| `429` | `dataset_count_limit`, `dataset_storage_limit` | Your account or the service holds as many datasets, or as much stored and reserved, as it may; `limit` or `limit_bytes` gives the limit (merged 2026-10-09). | Delete datasets you no longer need, failed ones first. |

## Examples

```sh
curl -s https://weights.fyi/run/v1/datasets \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "scavenge-teacher-2026-11-02-r1-sft",
    "format": "laya-student-sft/v1",
    "base_model": "fastino-glide-28b",
    "source_ref": {
      "manifest_uri": "s3://zyxioxyz-leadgen-artifacts/tenants/12/standing-pipes/distillation-finetune/datasets/scavenge-teacher/2026-11-02-r1/sft/manifest.json",
      "sha256": "57f9bfa243e5158181b1a5996157c5d056421c5bda1f4b19454bf6071c307a63",
      "row_count": 69556,
      "byte_size": 605187366,
      "compression": "none",
      "train_rows": 58996,
      "validation_rows": 5201
    }
  }'
```

```json
{
  "dataset_id": "ds_8126a1ce5538c9eb358c6aa9",
  "name": "scavenge-teacher-2026-11-02-r1-sft",
  "format": "laya-sft-chat/jsonl",
  "base_model": "fastino-glide-28b",
  "status": "ready",
  "rows": 69556,
  "train_rows": 58996,
  "validation_rows": 5201,
  "bytes": 605187366,
  "sha256": "57f9bfa243e5158181b1a5996157c5d056421c5bda1f4b19454bf6071c307a63",
  "source_ref": {
    "manifest_uri": "s3://zyxioxyz-leadgen-artifacts/tenants/12/standing-pipes/distillation-finetune/datasets/scavenge-teacher/2026-11-02-r1/sft/manifest.json",
    "sha256": "57f9bfa243e5158181b1a5996157c5d056421c5bda1f4b19454bf6071c307a63",
    "row_count": 69556,
    "byte_size": 605187366,
    "compression": "none",
    "train_rows": 58996,
    "validation_rows": 5201
  },
  "upload": null
}
```

## Patterns

### Two-step managed upload (`uploading` -> `PUT .../content`)

```sh
curl -s -i https://weights.fyi/run/v1/datasets \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
  -d '{"name": "my labelled pages", "format": "laya-page-role/jsonl"}'
```

```text
HTTP/1.1 201 Created
Content-Type: application/json
Location: /run/v1/datasets/ds_12be8b8818ceaf13696e7ff9

{
  "dataset_id": "ds_12be8b8818ceaf13696e7ff9",
  "name": "my labelled pages",
  "format": "laya-page-role/jsonl",
  "base_model": "laya-page-role-base",
  "labels": ["detail", "listing", "landing", "not_vacancy", "unresolved"],
  "status": "uploading",
  "error": null,
  "rows": null,
  "train_rows": null,
  "validation_rows": null,
  "bytes": null,
  "sha256": null,
  "created_at": "2026-10-09T08:28:09.826Z",
  "ready_at": null,
  "jobs": [],
  "upload": {
    "method": "PUT",
    "path": "/run/v1/datasets/ds_12be8b8818ceaf13696e7ff9/content",
    "content_type": "application/x-ndjson",
    "max_bytes": 461373440,
    "row": "one JSON object per line: id, split (train or validation), group_id, label (one of the model's labels), provenance, weight, state (the page text), optional state_sha256"
  }
}
```

## History

- 2026-10-08: live with fine-tuning: one format for one base model.
- 2026-10-09 (merged): credit needed; the largest size reserved; limits per account and for the service.

## See also

[GET /v1/datasets/{dataset_id}](/run/docs/reference/datasets-get.md), [Fine-tune a model](/run/docs/fine-tune.md).
