---
title: "Create a dataset log"
method: POST
path: "/api/datasets/{dataset_id}/logs/"
tags: ["datasets"]
---

# Create a dataset log

`POST /api/datasets/{dataset_id}/logs/`

Create a single dataset log from unified-format input/output data.

## Path parameters

- `dataset_id` string, required

## Headers

- `Authorization` string, required

## Request body

- DatasetLogCreateRequest — A dataset log object. The same shape is accepted by the single-create and bulk-create endpoints.
  - `input` union, required — Model or application input. Provide a string, structured object, or message/value array.
    - string
    - unknown[]
      - unknown
    - object
  - `output` union — Observed model or application output. Provide a string, structured object, or message/value array.
    - string
    - object
    - unknown[]
      - unknown
  - `expected_output` union — Optional ground-truth or target output used for evaluation.
    - string
    - object
    - unknown[]
      - unknown
  - `metadata` object — Additional context for this log, such as category, model, or log type.
  - `metrics` object — Numeric or structured measurements, such as token counts, cost, or latency.

## Response `201`

Dataset log created.

- DatasetsCreateDatasetLogResponse201
  - `message` string, required
  - `unique_id` string, required

## Other responses

- `400` — Invalid dataset-log payload.
- `401` — Unauthorized - Missing/invalid authentication
- `404` — Dataset not found.

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/4e064cf81dae/schema)
