Endpoints
All endpoints use
https://agent.tinyfish.ai and require the X-API-Key header. Datasets belong to your personal
account. Keys for an organization are refused with 403.
Plan a Spec
POST /v1/datasets/plan returns the columns TinySet would use for a prompt, so you can review and edit them before
anything runs. Planning can take up to a minute.
The response is
{ "spec": { ... } }. Pass that spec to POST /v1/datasets.
Create a Dataset
POST /v1/datasets takes exactly one of prompt or spec. With a prompt, TinySet plans the spec in the same
request, so the response can take up to a minute. With a spec, it returns right away.
Returns the dataset:
202 when a run started, 201 when populate is false.
Spec
A spec describes the dataset’s columns.plan returns one, and you can write or edit it yourself.
Each column:
Primary key columns decide when two rows are the same entity, so TinySet doesn’t add duplicates.
Dataset
run has id, status, started_at, and, once it ends, finished_at. A failed run also has error.
Statuses
A run’s
status is queued, running, done, failed, or cancelled. queued and running are in progress.
List Datasets
GET /v1/datasets returns { "data": [...], "pagination": { "next_cursor": "...", "has_more": true } }.
Read Rows
GET /v1/datasets/{id}/rows returns one page of rows. Cells in data are keyed by column name.
truncated is true when more rows follow at next_cursor.
Populate Again
POST /v1/datasets/{id}/populate starts a new run and returns the dataset with 202. An empty body uses the defaults.
Without
reset, the run keeps existing rows and adds new ones until the dataset has target_rows rows. If it
already has that many, the run ends without adding any. Only one run per dataset can be in
progress: a second populate returns 409.
Event Stream
GET /v1/datasets/{id}/runs/{run_id}/events returns text/event-stream. Each message has an event name and a JSON
data line.
events() reconnect if the connection drops.
Cancel a Run
POST /v1/datasets/{id}/runs/{run_id}/cancel returns { "run_id": "...", "status": "cancelling" }. The event stream
confirms with a final status of cancelled. Rows added before the cancel are kept.
Delete a Dataset
DELETE /v1/datasets/{id} returns { "id": "...", "deleted": true }. Cancel any run in progress first; deleting
during a run returns 409.
Errors
Errors use the standard JSON error body with anerror.code.
Limits
Runs are free during the beta.