Skip to content

Estimate Run

POST
/v1/datasets/{dataset_id}/estimate
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.

dataset_id
required
Dataset Id
string
Media typeapplication/json
RunRequest

What to run: the tasks, on the rows a query picks.

object
sql
Sql

Which rows to ask about: a SELECT over data returning __row_id; all rows by default.

string
default: SELECT * FROM data
tasks
required
Tasks
Array<object>
Task
object
id
Id
string
template
Template

The prompt, e.g. “Is this review negative? {{review}}”.

string
""
type
Type
string
default: yes_no
Allowed values: yes_no pick_one pick_any scale extract write
preset
Any of:
string
Allowed values: summarize translate
column
Column

Base name of the result columns. Defaults to one for the type.

string
default: answer
extraction_mode
Extraction Mode

Extraction editor: one scalar value or named, typed fields.

string
default: structure
Allowed values: single structure
options
Options

The choices for pick one and pick any; the levels, lowest first, for scale.

Array<object>
default:
Option
object
name
required
Name
string
description
Description
string
""
fields
Fields

For extract: what to pull out. "amount:number" is short for {"name": "amount", "type": "number"}.

Array<object>
default:
ExtractField
object
name
required
Name
string
type
Type
string
default: text
Allowed values: text number boolean date list items
description
Description

What to put in it, if the name doesn’t say.

string
""
fields
Array<object> recursive
reason
Reason

Also write why, from LLMs, for classify and extract.

boolean
models
Models

Decision models or LLMs; see GET /v1/utils/models. Defaults to one for the type.

Array<string>
default: typesafe/jev-1.14

Successful Response

Media typeapplication/json
Estimate
object
rows
required
Rows

Rows the run would ask about.

integer
calls
required
Calls

Model calls it would make.

integer
cost
required
Cost

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.

number
problem
required
Any of:
string

Example generated

{
"rows": 1,
"calls": 1,
"cost": 1,
"problem": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object

Example generated

{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}