Create Run
const url = 'https://example.com/v1/datasets/example/runs';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"sql":"SELECT * FROM data","tasks":[{"id":"example","template":"","type":"yes_no","preset":"summarize","column":"answer","extraction_mode":"single","options":[],"fields":[],"reason":false,"models":["typesafe/jev-1.14"]}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/datasets/example/runs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "sql": "SELECT * FROM data", "tasks": [ { "id": "example", "template": "", "type": "yes_no", "preset": "summarize", "column": "answer", "extraction_mode": "single", "options": [], "fields": [], "reason": false, "models": [ "typesafe/jev-1.14" ] } ] }'Queue a run of every task with every model on the rows in the scope (all rows if none is
given). It makes a new dataset (dataset_id), created right away with every row; the answer
columns of the rows in scope fill in as the run works through them in the background: poll
GET /v1/runs/{id} for its progress. Answers already given are free: they come from the
response cache.
A task needs only its template and type; the result column and models default to ones that
suit the type (see GET /v1/utils/task-types).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”What to run: the tasks, on the rows a query picks.
object
Which rows to ask about: a SELECT over data returning __row_id; all rows by default.
object
The prompt, e.g. “Is this review negative? {{review}}”.
Base name of the result columns. Defaults to one for the type.
Extraction editor: one scalar value or named, typed fields.
The choices for pick one and pick any; the levels, lowest first, for scale.
object
For extract: what to pull out. "amount:number" is short for {"name": "amount", "type": "number"}.
object
What to put in it, if the name doesn’t say.
Also write why, from LLMs, for classify and extract.
Decision models or LLMs; see GET /v1/utils/models. Defaults to one for the type.
Responses
Section titled “Responses”Successful Response
object
The dataset it makes.
The query and tasks it was started with.
object
Which rows to ask about: a SELECT over data returning __row_id; all rows by default.
object
The prompt, e.g. “Is this review negative? {{review}}”.
Base name of the result columns. Defaults to one for the type.
Extraction editor: one scalar value or named, typed fields.
The choices for pick one and pick any; the levels, lowest first, for scale.
object
For extract: what to pull out. "amount:number" is short for {"name": "amount", "type": "number"}.
object
What to put in it, if the name doesn’t say.
Also write why, from LLMs, for classify and extract.
Decision models or LLMs; see GET /v1/utils/models. Defaults to one for the type.
The answer columns, each with a _proba column.
Per task and model, so far.
object
USD spent by this run; cached answers are free.
Rows without an answer.
Rows it asks about: the rows in its scope.
The first chunk of rows not yet written.
Model calls answered (or failed) so far.
Model calls the run makes.
USD spent so far; cached answers are free.
Example
{ "status": "queued", "config": { "sql": "SELECT * FROM data", "tasks": [ { "template": "", "type": "yes_no", "preset": "summarize", "column": "answer", "extraction_mode": "single", "options": [], "fields": [], "reason": false, "models": [ "typesafe/jev-1.14" ] } ] }}Validation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}