Browse documentation
DocsBuild & reference
Implemented code

NeuraMesh local API reference

Updated · Published by NeuraMesh

The local Node server (npm run api, default localhost:8787) exposes status and health, two external market-data proxies, a provider registry with authenticated heartbeats, a job lifecycle verified by server re-execution of deterministic CPU workloads, an evidence record per job, a simulated settlement ledger, and three refused write routes (orders, swap quotes, settlements answer 501). State lives in a local SQLite file. There is no GPU execution, matching, wallet signing, real payment or hardware attestation; the hosted site has no database, so its provider and job routes answer 501. The complete, maintained inventory is docs/API.md in the repository.

On this page

Base URL and safety boundary#

Start the server with npm run api. The default port is 8787, configurable through NEURAMESH_API_PORT. The Vite development proxy forwards /api calls to that default port. These are local development endpoints, not a documented hosted production API.

The server validates every JSON body against a schema and answers one structured error shape (400, 401, 403, 404, 409, 413, 415, 422, 429, 501, 503). Job routes need a buyer API key (loopback requests are accepted only in development when no keys are configured); provider routes need the bearer token issued at registration; registration itself can be gated by a registration key and is rate limited per address. Idempotency-Key is honoured per buyer on job creation. State persists in a local SQLite file. CORS allows one configured origin. It remains a development API: no TLS, no accounts, no audit, so keep it on a trusted machine and do not expose it to untrusted traffic without the production configuration described in .env.example.

Base URL and safety boundary
Method / pathSuccess statusActual behavior
GET /api/health200Returns status ok, the stage label, the execution mode and the server time
GET /api/gpu-prices200Proxies an external public GPU price feed; 503 when upstream fails
GET /api/stock-history200Proxies daily closes for five listed compute companies; 400 off the allow-list
GET /api/markets200Reports status unavailable; returns an empty markets array
GET /api/portfolio200Reports account access as unavailable; returns no balances or positions
POST /api/orders501Refused; nothing is validated, matched or stored
POST /api/swap/quote501Refused; no quote is calculated
POST /api/settlements501Refused; no record is created
GET /api/status200Project status generated from protocol-config.js; also at /status.json
GET /api/providers200 locally, 501 hostedSelf-reported provider inventory with heartbeat freshness; no entry is hardware-verified
POST /api/jobs201 locally, 501 hostedCreates a deterministic test job; state machine CREATED → RESERVED → RUNNING → COMPLETED → VERIFIED → SETTLED with server re-execution and a simulated ledger

GET /api/health#

This endpoint is the simplest backend connectivity check. The stage field repeats the canonical project stage label and executionMode says whether jobs run on the labelled development simulator or wait for a registered provider agent. It proves the process is up, not that any GPU, chain or storage connection exists; read GET /api/status for that.

Responsejson
{"status":"ok","stage":"live","executionMode":"simulator","time":"2026-10-14T11:18:34.191Z"}

GET /api/gpu-prices#

Returns NeuraMesh prices per GPU-hour for each GPU and service plan (Data center and Value), with an availability label. Prices are calculated on the server from market price data, fetched in parallel and cached for five minutes, plus the NeuraMesh margin. Capacity for each order is sourced from the NeuraMesh supply network after the request is received. The optional limit parameter (1 to 100, default 50) caps how many GPU types are returned.

Prices are estimates. The final price and availability are confirmed by email before payment. If some price sources fail the route still answers from the rest; only when every source fails does it return HTTP 503, never stale or invented prices.

Response shapejson
{
  "kind": "estimate",
  "currency": "USD",
  "unit": "GPU-hour",
  "retrievedAt": "<ISO timestamp>",
  "totalGpuTypes": 57,
  "gpus": [ {
    "id": "h100-80gb", "name": "H100", "class": "datacenter", "memoryGb": 80,
    "fromUsd": 1.54, "availability": "available",
    "plans": [ { "id": "datacenter", "label": "Data center", "priceUsd": 1.91, "availability": "available" },
               { "id": "value", "label": "Value", "priceUsd": 1.54, "availability": "available" } ]
  } ],
  "models": [ /* market reference rows used by the Trade screen */ ]
}

POST /api/order-request#

Submits a GPU order request: GPU id, plan, GPU count (1 to 512), hours (1 to 8,760), workload, region, optional machine spec, and the customer's name, email, optional company and notes. The server reprices the request from the current catalog, ignoring any price sent by the browser, and delivers it to the operations team by email. It answers 202 with a reference such as NM-261104-3F9A2C, the plan price and the estimate.

Nothing is charged. The team sources the capacity from its supply network, then emails the customer a confirmed quotation with the final price and a secure payment link, typically within one business day. Invalid input answers 422, an unknown GPU or plan 409, too many requests from one network 429, and a delivery failure 503 with retryable set.

GET /api/stock-history#

Returns daily closing prices for one of five listed companies whose results track AI compute demand: NVDA, AMD, MSFT, AMZN and GOOGL. Accepted ranges are 1mo, 3mo, 6mo and 1y. Symbol and range are both checked against an allow-list, so an unrecognised value returns 400 rather than being forwarded upstream. Responses are cached for fifteen minutes.

The upstream is a public but undocumented endpoint with no stability guarantee or redistribution licence, so treat it as reference context rather than a dependable source. These are equity prices: they describe a company, not the cost of a GPU-hour, and they are not a NeuraMesh market, quote or tradable instrument. Any failure returns 503 and the interface falls back to its own labelled series.

Request and response shapejson
// GET /api/stock-history?symbol=NVDA&range=3mo\n{\n  "symbol": "NVDA",\n  "range": "3mo",\n  "name": "NVIDIA Corporation",\n  "currency": "USD",\n  "source": "Yahoo Finance",\n  "retrievedAt": "<ISO timestamp>",\n  "points": [ { "t": <epoch ms>, "v": <close> } ]\n}

GET /api/markets and GET /api/portfolio#

Markets no longer returns sample contracts. It responds 200 with status unavailable, an empty markets array and a reason string, because claim markets are on the roadmap and none is published yet. There is no query filtering, individual-market route or reference index endpoint.

Portfolio returns status unavailable with null account, balances and positions. No wallet or account system is connected, so the endpoint cannot report any user holdings or returns.

Markets and portfolio responsesjson
// GET /api/markets
{
  "status": "unavailable",
  "markets": [],
  "reason": "NeuraMesh Trade markets are on the roadmap. Rent GPUs and see current prices at /marketplace."
}

// GET /api/portfolio
{
  "status": "unavailable",
  "account": null,
  "balances": null,
  "positions": null,
  "reason": "Portfolio accounts are on the roadmap."
}

POST /api/orders, /api/swap/quote and /api/settlements#

All three write routes are refused. The server matches the method and path, then returns HTTP 501 with a structured error object: code FEATURE_NOT_IMPLEMENTED, a message and retryable false. It does not read the request body, validate fields, calculate a quote, allocate collateral, reserve provider capacity or keep a record. Restarting the process changes nothing, because nothing is stored.

Earlier revisions of this scaffold staged caller-supplied objects in process memory and returned 201 or 200. That behavior has been removed, so no local response can be mistaken for an accepted order, a usable swap rate or a settlement record. Treat these routes as placeholders for flows that production must define with validated schemas, authenticated account authority and idempotency keys.

Refused write requestshell / json
curl -i -X POST http://localhost:8787/api/orders \
  -H "Content-Type: application/json" \
  -d '{"symbol":"NM.H100.US-EAST.2026-11","side":"buy","hours":100}'

HTTP/1.1 501 Not Implemented
{
  "error": {
    "code": "FEATURE_NOT_IMPLEMENTED",
    "message": "/api/orders is not enabled in this release. Order execution, swaps and settlement are not implemented; see /api/status.",
    "retryable": false
  }
}

Errors and the path to a real contract#

Unknown method/path combinations fall through to HTTP 404 with an error of Not found. An unhandled exception, such as an upstream failure outside the price proxy guard, returns HTTP 400 with the exception message. OPTIONS receives a 204 response. The scaffold does not define a stable typed error taxonomy or a complete cross-origin API policy.

Before any production integration, define validated and versioned request schemas, protected server-owned fields, durable state, authenticated account authority, idempotency keys, limits and audit events. Add explicit transaction receipts for signed actions. The architecture document suggests future /v1 discovery and evidence services, but those endpoints are not implemented in server/api.js.

Common questions

Can I place an order against this API?

No. POST /api/orders, /api/swap/quote and /api/settlements all return HTTP 501 and store nothing. There is no matching, risk, payment or signed settlement workflow.

Are /v1/markets or reservation-evidence endpoints available?

They are architecture suggestions, not implemented routes in the inspected Node server.

Sources & implementation status

Based on the NeuraMesh investor brief and the project sources below. Source review: . Updated . Design explanations are not a deployment audit, legal opinion or commitment to launch.

Read our source and status conventions. Suggest a correction.