Reference
The HelixDB HTTP API accepts operation-tree queries at POST /v2/query, Cypher
statements at POST /v2/cypher, read-only Cypher planning at
POST /v2/cypher/explain, and SQL at POST /v2/sql and POST /v2/sql/explain.
Local servers and Helix Cloud gateways serve the same contracts.
Machine-readable specification
The canonical OpenAPI 3.1 document is published at both predictable URLs: Use the specification to discover request headers, response codes, health endpoints, query-envelope variants, and example read and write requests. Use the typed SDKs orhelix query to build the nested operation tree.
Endpoint
http://localhost:6969/v2/query by default. For Helix
Cloud, use the gateway URL and database ID shown in the dashboard. The
cluster.helix-db.com hostname in the OpenAPI document is a placeholder, not a
shared query endpoint.
The root OpenAPI server and the /healthz, /readyz and /v2/diagnostics
operations describe a local HelixDB server. The Helix Cloud gateway server is
advertised on POST /v2/query and the Cypher and SQL operations. Instead of
/healthz and /v2/diagnostics, a gateway serves unauthenticated GET /health
(liveness) and GET /readyz (readiness), whose bodies this specification does
not describe.
GET /v2/diagnostics returns read-only checks of the server’s setup: storage,
the S3 bucket’s region, the disk cache’s device and room, memory, index
publication, and recent queries’ index use.
helix doctor renders it.
GET /v2/diagnostics?audit=labels also audits stored data: its
indexes.label_bitmaps check reads every node and edge row once and fails when
a row is missing from its label’s bitmap, which label scans and index builds
read. The audit changes nothing and runs only when asked for, one at a time;
requests that arrive while one runs share its result. Any other audit value
fails with invalid_request_option.
Local HelixDB accepts encoded request bodies up to 16 MiB. The Helix Cloud
gateway accepts up to 2 MiB. Keep requests at or below 2 MiB when the same
client must work against both environments. A POST /v2/query body may nest
JSON arrays and objects at most 255 levels deep, including under keys the
server ignores, and a Cypher or SQL body at most 127 levels; a deeper body
fails with invalid_query_json.
Compression
A Helix Cloud gateway decodesContent-Encoding: gzip or x-gzip request bodies
(identity means none) and applies its 2 MiB limit after decoding. Any other
coding returns 415 unsupported_content_encoding with Accept-Encoding: gzip.
It gzips responses over 32 bytes when the request sends Accept-Encoding: gzip.
A local server neither decodes nor compresses: a gzipped body fails with
400 invalid_query_json. Clients that target both should send uncompressed JSON.
Authentication
Local servers have no authentication: any client that reaches the port can read and write, so keep one on a trusted network or behind an authenticating proxy. By default the server binary listens on every interface (HTTP 8080, gRPC 8081), the Docker image binds gRPC to127.0.0.1:8081 inside the container, and the CLI
publishes HTTP as 6969 on every host interface.
A Helix Cloud GA shared gateway requires a cluster API key and database ID:
X-Helix-Tenant-Id remains a legacy alias in GA mode. Database-specific
cluster-mode gateway URLs require the API key but reject both database and
tenant selection headers. Use the endpoint mode shown in the dashboard; do not
copy headers between the two modes.
The TypeScript SDK (@helix-db/helix-db 3.2.0 and later) sends
X-Helix-Database-Id after client.withDatabaseId("<database-id>"). The
published Python, Rust, and Go SDKs do not expose the GA database-selection
header; use them with a database-specific cluster gateway URL, or use direct
HTTP for a GA shared gateway.
Create or rotate the cluster key in the Helix Cloud dashboard. Do not put keys
in source control, agent instructions, llms.txt, or catalog manifests.
The hosted HelixDB MCP server uses WorkOS OAuth for human sessions and the WorkOS agent registration
flow for agents. See the HelixDB MCP guide and the public
HelixDB authentication guide.
Request envelope
request_type and the single query variant must agree: read with read, or
write with write. query_name is optional diagnostic metadata. Parameters
can be untyped, or every parameter can have a matching entry in
parameter_types. Read requests can set search_consistency to strong (the
default) or eventual; write requests accept only strong. See
Search consistency.
Raw HTTP JSON supports f32 and f64 parameter declarations. The decoder
converts integer JSON values such as 5 and floating-point values such as 5.25
to the declared floating-point type. Values must be finite, and f32 values must
fit within the finite f32 range. Floating-point parameters may also be untyped;
when parameter_types is present, it must describe every supplied parameter.
Execution headers
Boolean execution headers accept
true, false, 1, or 0. Warm writes and
durability waits on reads are rejected with 400 Bad Request.
Responses
200returns a JSON object keyed by the requested return variables.204means Helix Cloud completed a cache-warming read without a body.400reports invalid input or request options. On Helix Cloud, it also reports a missing or malformed authentication header.401reports an invalid Helix Cloud API key.402reports that Helix Cloud query processing is disabled because credit is exhausted.403reports that the Helix Cloud API key lacks permission for the query.404reports that the query named a node, edge, index or index operation that does not exist.408reports an exceeded deadline:query_deadline_exceededfrom the engine orquery_timeoutfrom a Helix Cloud gateway. Locally,POST /v2/queryhas no execution deadline and Cypher and SQL have 30 seconds. A write that awaits durability returns408after 30 seconds without its WAL upload, although it is already applied: read the state back before resending.409reports a conflict that committed nothing; branch onretryable. Withtrue(such astransaction_conflict), resend with bounded backoff. Withfalse(such asunique_constraint_violation), resending unchanged fails again.413reports that a Helix Cloud request body exceeded 2 MiB. The gateway rejects it before query parsing.415reports a Helix Cloud request body whoseContent-Encodingis notgziporidentity(unsupported_content_encoding).429reports a Helix Cloud rate limit (rate_limited), index backpressure (index_backpressure), or an exceeded per-query budget (resource_limitfor Cypher and SQL,query_memory_limit_exceededforPOST /v2/query). Only some are transient, so branch onerrorand do not retry every429; see HTTP 429.500reports an internal query or storage failure.503reports that a required writer or ready database is unavailable, or, withretryable: false, that a write’s outcome is unknown.
{ "error": "<code>", "msg": "<message>" }, plus a boolean retryable when the
code’s failure class
settles it (409, index_backpressure and an unknown write outcome). Clients
should branch on error and treat msg as diagnostic text. An oversized Cloud
request uses payload_too_large as its stable error code. On a local server, an
unknown path or method returns an empty 404 or 405 instead of this envelope. See the
query error reference for engine
error codes and retry guidance, and
Helix Cloud gateway errors for
gateway codes.
Response timing
A local server reports where its time went on every response to aPOST /v2/query, POST /v2/cypher or POST /v2/sql request, and to their
explain routes, as a standard
Server-Timing header in milliseconds:
The metrics never overlap, and the clock starts once the request body has fully
arrived, so their sum is the server’s share of the latency a client measured.
The rest is network and upload time. A failed or explained request reports
exec alone, and a request rejected before its body is read reports nothing. Over
gRPC, the same value is the server-timing response metadata, timed from the
moment the handler receives the message and present on every response.
One durable wait is not separated: when an insert extends the writer’s ID lease
(its first insert, then rarely), that upload counts in exec.
Cypher
Send a single statement with optional parameters and a query name. The server determines whether the statement reads or modifies data. A Helix Cloud gateway uses that to route reads to readers and writes to the elected writer.ORDER BY. Successful writes without
RETURN produce empty columns and rows. Each modifying statement uses one
atomic transaction. The authentication and read/write execution headers above
apply. A read-only Helix Cloud API key can read and explain, but receives 403
for a modifying statement. Cloud database-selection headers do not select a
database on a standalone server.
The Cypher guide lists which clauses,
expressions, and functions are supported, and which constructs are rejected with
an unsupported_feature error, such as MERGE, variable-length paths, and UNION,
and shows how to upsert without MERGE.
Lossless JSON values
Null, booleans, strings, finite floats, lists, and ordinary maps use JSON values. Use these envelopes when plain JSON would lose meaning:
Graph IDs are unsigned decimal strings.
id() checks signed 64-bit conversion
and reports overflow. Path elements are ordered, while relationship endpoints
retain their stored direction. Internal metadata is excluded from property maps.
Scalar, list, and map values, including their envelopes, can be supplied as
parameters. Graph elements cannot be passed as parameter values.
Cypher errors and planning
Cypher errors includeerror, msg, and details with a specific detail,
phase (compile or runtime), and a nullable UTF-8 byte span. error and
detail are lower snake case codes, such as resource_limit and memory_limit;
the query error reference
lists the categories. Malformed requests and storage errors retain the native
envelope, the only one that carries retryable. Resource
limits return 429; request/semantic errors return 400; conflicts return
409 (a duplicate unique value is unique_constraint_violation); internal
failures return 500; writer requirements or uncertain commits return 503.
An uncertain commit includes retryable:false and must not be retried automatically.
The local request and response limits are 16 MiB, with a default 30-second query
deadline. An oversized request returns 400 with invalid_request_body. See
Cypher limits for per-statement
budgets. A Helix Cloud gateway accepts request bodies up to 2 MiB and returns 413 with
payload_too_large above that. Its query time limit returns 408, and its rate
limit applies as for POST /v2/query. Gateway authentication, rate-limit and
availability errors use the native envelope.
Resource exhaustion returns an error instead of a truncated successful result.
Send the same request to POST /v2/cypher/explain to inspect selected access
paths, estimated cardinalities, blocking work, Cartesian products, and optimizer
budget warnings. This endpoint returns planning data separately from query
results and does not execute the statement, including writes. It uses read
request options, so X-Helix-Await-Durable:true is invalid.
SQL
Local servers and Helix Cloud gateways also accept one SQL statement atPOST /v2/sql. It translates the statement to Cypher and runs it as
POST /v2/cypher would, with the same authentication, execution headers,
routing, results, and error body. The body adds optional mappings,
and parameters may be a list that binds ? placeholders in written order:
POST /v2/sql/explain takes the same body and plans the translated statement
without executing it, exactly like POST /v2/cypher/explain: it returns the same
planning report and uses read request options, so X-Helix-Await-Durable:true
is invalid. The report does not include the translated Cypher text.
The SQL guide describes how tables, columns
and joins translate, and which SQL is rejected.
Next steps
helix querybuilds and sends requests from JSON or the TypeScript DSL.- Build and run a query explains the operation tree.
- Parameters defines typed and untyped runtime values.