Docs

Reference

Your agent gets all of this from the guide and describe tools, so most people never read it. It's here for when you want to know exactly what a query can do, or you're writing against the API yourself.

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. A sort needs a limit.
  • A summary: aggregate or distinct, then optionally sort and limit.
  • Rows read by a model: select, optional sort, limit, then one classify or extract.

Filters

Each condition names a column. Which conditions a column takes depends on what it is; describe lists them for a table.

OnConditionsNotes
textphrase, containsphrase: the words next to each other, in order. contains: all the words, anywhere in the row's text.
A value fieldeq, inExact values such as a language, a country or an identifier. in takes up to 1,000.
_keyeq, in, prefix, rangeThe row's key. Rows are stored in key order.
Any stored columneq, in, prefix, range, is_nullChecked by reading each row the indexed part found, so it must sit beside an indexed condition inside all.
Web page tableshost, domain, url with eq or inOne 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) and nova-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.
  • keep on 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.

RequestDoesCharged
GET /v1/guideHow to query, worked examples, your plan and balanceNo
GET /v1/tablesTables and their versionsNo
GET /v1/tables/{name}One table: columns, filters, build dateNo
POST /v1/estimateBody {"query": …}. Rows it may return and a range of creditsNo
POST /v1/queryBody {"query": …, "max_credits": n}. Runs it. Answers with the result, or with "status": "running" if it takes longer than 20 secondsYes
POST /v1/resultBody {"query_id": …}. The answer of a query that was still running. With "next", the next page of a large resultNo
GET /v1/accountPlan, credits, limitsNo
GET /v1/usageYour last 50 queries and credit entriesNo
GET, POST /v1/keys, DELETE /v1/keys/{id}List, make and revoke API keysNo

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.

ToolSame as
guideGET /v1/guide. Agents should call this first.
describeGET /v1/tables, or one table when given table
estimatePOST /v1/estimate
queryPOST /v1/query
resultPOST /v1/result
accountGET /v1/account
create_api_keyPOST /v1/keys. Only when you ask your agent for a key.

Errors

HTTPCodeMeaning
400rejectedThe request is malformed. reason says what to change.
401unauthorizedNo key or token, or one that isn't valid.
402no_creditsThe account, or the key's own cap, has nothing left.
403forbiddenThe account is suspended, or the address hasn't been invited.
429rate_limitedMore requests in a minute than the plan allows.
503pausedFree-month queries or model steps are paused for the moment.
500failedOur 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, and result gives 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 reason max_seconds and 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, and result with 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}} after select: 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.