A query
A query is JSON. It names one table at one exact version and lists steps, which run in order. Get table names and versions from describe.
{ "language": 1,
"source": { "table": "duleno.site_pages", "version": "2026-11-30" },
"steps": [
{ "filter": { "phrase": { "column": "text", "value": "heat pump installation" } } },
{ "select": ["seed", "pages.title"] },
{ "limit": 20 }
] }
The first step is always a filter, and it must include at least one condition an index can answer (text, a value field, or the key). duleno doesn't scan whole tables. After the filter, steps come in one of three shapes:
- Rows:
select,sort,limit, each optional, in that order. Asortneeds alimit. - A summary:
aggregateordistinct, then optionallysortandlimit. - Rows read by a model:
select, optionalsort,limit, then oneclassifyorextract.
Filters
Each condition names a column. Which conditions a column takes depends on what it is; describe lists them for a table.
| On | Conditions | Notes |
|---|---|---|
text | phrase, contains | phrase: the words next to each other, in order. contains: all the words, anywhere in the row's text. |
| A value field | eq, in | Exact values such as a language, a country or an identifier. in takes up to 1,000. |
_key | eq, in, prefix, range | The row's key. Rows are stored in key order. |
| Any stored column | eq, in, prefix, range, is_null | Checked by reading each row the indexed part found, so it must sit beside an indexed condition inside all. |
| Web page tables | host, domain, url with eq or in | One site, a domain and everything under it, or one page. |
Combine conditions with all, any and not:
{ "filter": { "all": [
{ "phrase": { "column": "text", "value": "integrates with" } },
{ "contains": { "column": "text", "value": "salesforce" } },
{ "not": { "contains": { "column": "text", "value": "hubspot" } } }
] } }
Matching is literal and ignores case. There's no stemming: “dentist” does not match “dentists”. Search the variants you care about with any.
Rows
select takes a list of columns. A dotted path reaches into a record, and a path through a list returns a list: pages.title is the titles of all the pages kept for a site. Without select, a row is its whole record.
sort orders by one column, ascending or descending, and returns the first limit rows, up to 10,000. Without a sort, rows come in key order, which for site tables keeps a domain's rows together.
{ "select": ["seed", "server"] },
{ "sort": { "by": "seconds", "order": "desc" } },
{ "limit": 10 }
Counts and groups
A plain count is answered from the index and is the cheapest query there is. Use it to size an answer before fetching rows.
{ "aggregate": { "measures": { "sites": { "count": "*" } } } }
With group_by, you get one row per group. Up to four columns. A row whose column holds a list is counted once under each different value in it.
{ "aggregate": { "group_by": ["server"], "measures": { "sites": { "count": "*" } } } },
{ "sort": { "by": "sites", "order": "desc" } },
{ "limit": 10 }
distinct lists the different values of up to four columns, without counts. Grouping reads each matching row, so its cost grows with the number of matches. A query that would produce more than 200,000 groups fails and asks for a narrower filter.
Model steps
A model step comes last. It reads the columns named in input for each row and adds one column. The query must have a limit, and the request must carry max_credits.
{ "classify": {
"model": "nova-micro",
"input": ["pages.title", "pages.text"],
"instruction": "Is this the website of a company that does contract CNC machining?",
"labels": ["machine shop", "other"],
"keep": ["machine shop"],
"as": "kind" } }
{ "extract": {
"model": "nova-lite",
"input": ["pages.title", "pages.text"],
"instruction": "This is a business website. Read what it says about itself.",
"fields": {
"name": "string",
"town": { "type": "string", "description": "Town the business is located in" },
"certifications": "strings",
"is_machine_shop": "boolean" },
"as": "facts" } }
- Models:
nova-micro(cheapest, good for sorting into labels) andnova-lite(better at extraction). - How much it reads: the first 4,000 characters of the input by default. Raise it with
max_input_chars, up to 20,000. More text costs more. - Field types:
string,number,boolean,strings(a list). A field the text doesn't answer comes back null. keepon a classify returns only rows given those labels.- Runs over 1,000 rows start with 48 to measure the cost per row, and stop there if the full run wouldn't fit in
max_credits.
HTTPS API
Base address https://api.duleno.com. Send an API key from your account page as Authorization: Bearer dln_.... Every answer is a JSON object with a status.
| Request | Does | Charged |
|---|---|---|
GET /v1/guide | How to query, worked examples, your plan and balance | No |
GET /v1/tables | Tables and their versions | No |
GET /v1/tables/{name} | One table: columns, filters, build date | No |
POST /v1/estimate | Body {"query": …}. Rows it may return and a range of credits | No |
POST /v1/query | Body {"query": …, "max_credits": n}. Runs it. Answers with the result, or with "status": "running" if it takes longer than 20 seconds | Yes |
POST /v1/result | Body {"query_id": …}. The answer of a query that was still running. With "next", the next page of a large result | No |
GET /v1/account | Plan, credits, limits | No |
GET /v1/usage | Your last 50 queries and credit entries | No |
GET, POST /v1/keys, DELETE /v1/keys/{id} | List, make and revoke API keys | No |
A query's answer:
{ "status": "complete",
"rows": [ { "server": "cloudflare", "sites": 656 }, … ],
"result": { "rows": 8 },
"credits": { "charged": 6, "balance": 5994 } }
status is complete, stopped (a limit was reached; reason says which, and the rows so far are returned), rejected (the query is wrong; reason and step say where) or failed. During the free month, a list also carries sample, which says how many rows matched and how many were shown.
MCP tools
The MCP server at https://mcp.duleno.com/mcp offers the same operations as tools. It speaks Streamable HTTP and signs users in with OAuth.
| Tool | Same as |
|---|---|
guide | GET /v1/guide. Agents should call this first. |
describe | GET /v1/tables, or one table when given table |
estimate | POST /v1/estimate |
query | POST /v1/query |
result | POST /v1/result |
account | GET /v1/account |
create_api_key | POST /v1/keys. Only when you ask your agent for a key. |
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | rejected | The request is malformed. reason says what to change. |
| 401 | unauthorized | No key or token, or one that isn't valid. |
| 402 | no_credits | The account, or the key's own cap, has nothing left. |
| 403 | forbidden | The account is suspended, or the address hasn't been invited. |
| 429 | rate_limited | More requests in a minute than the plan allows. |
| 503 | paused | Free-month queries or model steps are paused for the moment. |
| 500 | failed | Our fault. You aren't charged. |
A query that the engine rejects, such as one naming a column that doesn't exist, comes back with HTTP 200 and "status": "rejected", with the reason and the number of the step at fault.
Limits
- A query runs for as long as it needs, up to what you let it spend. If it isn't done in 20 seconds, the answer is
"status": "running"with the query's id, andresultgives its answer when it's ready. You're charged once, when it ends. - A model step can run for hours. Any other query stops after 13 minutes with
reasonmax_secondsand returns what it has. - An answer holds about one megabyte of rows. A larger result comes a page at a time: the answer has
next, andresultwith that value gives the rows after it. Results can be read for seven days. - To read what a page says about your search without taking the whole page, add
{"snippets": {"text": 300}}afterselect: the column comes back as about 300 characters around the first match. - One request can spend at most 12,500 credits.
- A model step reads up to the number of rows your plan allows per query.
- Request rates per minute: 12 on the free month, 60 on Starter, 120 on Plus, 240 on Pro.