HTTP API server

The demos stack serves a JSON API on :18101 (the port may differ once you adapt the compose file). Paths match the Python BatchClient methods. Send Content-Type: application/json.

Common fields

FieldTypeDefaultUsed by
backendstring"duckdb"Query and productivity routes
structuredboolfalsequery, translate, validate, diagnose, describe, help
debug"off" | "info" | "debug" | "trace""off"Same set (not sltest)
optimizestringserver defaultquery, translate, validate, diagnose
structuredYou get
false (default)Short display form (slt or markdown text)
trueFull result: sql, dataframe, errors, and tool-specific fields

Use "structured": true whenever your script needs rows, SQL, or typed errors. The Python package already returns those fields without this flag.

Leave debug at "off" unless you are investigating a compiler issue and need on-disk pipeline logs.

Routes

GET /capabilities — enabled endpoints, backends, and optional serving executors.

GET /health — liveness.

POST /query — run FeatureQL. Body: query (FeatureQL text only, not SLT harness blocks), backend, structured, optional DuckDB timeit. Structured responses include sql, dataframe, errors, warnings, and timings. Errors look like:

{
  "code": "UE/…",
  "message": "…",
  "location": [{"line": 1, "column": 10}],
  "hint": "… optional"
}
json

POST /translate — same body as /query, without execution.

POST /validate — formatting, feature graph, optional SQL dry-run. detail is "compact" (default) or "full". Structured fields include formatted_featureql, output_schema, features, warnings, sql_valid, generated_sql. Method meaning: Python library tools .

POST /diagnose — incremental run until the first failure. Fields: failed_step, steps, explain_json.

POST /describe — body prefixes (at least one non-empty namespace). Returns sources (NAME + FORMULA), one Grains table (entity / input / keyset), a POSITION-ranked derived sample (max 20) with derived_total, plus next_queries (SHOW … IS_DOWNSTREAM_OF, full names) when structured is true. Markdown uses short names — qualify with FROM <ns> or <ns>.FEATURE_NAME.

POST /help — terms (keys or free text, such as ["locf"] or ["fill missing values"]), more (length of the ranked "more" list per term, default 5, 0 disables it), snippets (how many snippets of a resolved page to inline in full, default 0; the rest are one-line pointers).

POST /sltest and POST /sltest_stream — run documentation tests. Bodies are mutually exclusive: where + limit (FeatureQL predicate; dependency-aware) or source (must return NAME and CONTENT). Guide: Conformance tests .

POST /sltest_multi — multi-backend execution when the server is configured for it.

POST /direct_sql_query — raw SQL through the server’s optional SQL executor — not FeatureQL.

A successful HTTP status can still include errors: […]. Invalid request bodies return VALIDATION-ERROR with the same shape.

BASE=http://localhost:18101

curl -s "$BASE/capabilities"

curl -s -X POST "$BASE/query" \
  -H "Content-Type: application/json" \
  -d '{"query":"RETURN F := 1;","backend":"duckdb","structured":true}'
bash

Related