Estimate Run
const url = 'https://example.com/v1/datasets/example/estimate';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/estimate \ --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" ] } ] }'What POST /v1/datasets/{id}/runs with the same body would take and roughly cost, and why
it can’t run as it is, if so. Nothing is asked.
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
Rows the run would ask about.
Model calls it would make.
Roughly what it would cost in USD, from sample rows’ token counts and the models’ prices; answers already in the response cache would be free.
Example generated
{ "rows": 1, "calls": 1, "cost": 1, "problem": "example"}Validation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}