Beta. STARCO Dev works with synthetic data only: do not send real personal or health data. Every feature shows its real status (Available Beta Beta · in development Coming).

Documentation menu

Concepts

The vocabulary of a twin.

A dozen ideas cover the v1 API. Each one says where it stands today.

reading time about 26 min

Accounts and console tokens Beta#

A developer account has an email, a password and the version of the developer terms it accepted (GET /v1/terms, then POST /v1/accounts with accept_terms_version). Signing in with POST /v1/sessions returns a console token, starco_dc_…, valid for 12 hours and shown once. The console token manages the account, its projects and their keys; it cannot read twins. DELETE /v1/sessions/current revokes it; GET /v1/sessions lists the open sessions of the account and DELETE /v1/sessions/{session} closes any of them. DELETE /v1/account, with the password, erases the account with all its projects, keys, twins and audit chains and returns a receipt. The address is verified with a single-use link before the first sign-in (POST /v1/accounts/verify), and a forgotten password is reset with POST /v1/password/forgot and POST /v1/password/reset, which closes every session.

Projects and the cohort Beta#

A project is the box everything else lives in: twins, keys, its rate limit and its audit chain. Every project is "data_class": "synthetic": synthetic data only. A new project comes with a cohort of 8 synthetic twins ("origin": "synthetic_cohort", labelled synthetic-01 to synthetic-08, with both layers), each with the 14 days that end yesterday; the values are generated deterministically from the project, so they are reproducible and never random. PATCH /v1/projects/{id} renames a project or sets rate_limit_per_minute between 1 and 600.

Keys and scopes Beta#

Your code authenticates with a project key, starco_dk_…, sent as Authorization: Bearer …. A key belongs to one project: a twin of another project answers 404, exactly like one that does not exist.

ScopeAllows
readTemplates, list and read twins, observations, layers, export, and read and verify the audit chain.
writeCreate and erase twins, send observations. It does not include read.

You choose the scopes of each key and its ttl_days (30 by default, 90 at most). The secret is shown once and STARCO stores only a keyed hash of it. DELETE /v1/projects/{id}/keys/{key} revokes a key at once. A key that is revoked, expired or lacks the scope is refused (key_revoked, key_expired, insufficient_scope with needs), and the refusal is written to the project's audit chain too.

Twins and templates Beta#

A twin is a data model of one person, synthetic in the sandbox: a set of layers that recompute as observations arrive. You create it with POST /v1/twins from a template and switch on the layers you need; an optional label (up to 64 letters, digits, spaces, _, . or -) helps you find it. Labels that look like real identifiers, such as a phone number, a national id or a long number, are refused with identifier_not_accepted.

The templates come from the STARCO twin engine: sports_performance, sleep_optimization, cellular_longevity, executive_stress, daily_movement and food_hydration. A template sets the order in which its wellness kinds are listed; every kind of a layer is accepted on any twin with that layer. A twin has an id (a UUID), template, layers, label, origin (api or synthetic_cohort), data_class and its timestamps.

Layers and kinds Beta#

A layer groups the kinds of one aspect of a twin. Layers are independent: a twin can have just one. Each kind has one unit, written exactly as below, and accepted bounds. The bounds only check that a value is recordable; they are not reference ranges and say nothing about the person. GET /v1/templates returns this catalogue.

LayerKindUnitAccepted
wellnesssleep_hoursh0 to 24
sleep_quality · exercise_intensityrating_1_101 to 10, integer
nap_minutesmin0 to 240, integer
exercise_minutesmin0 to 1440, integer
strength_sessionscount0 to 10, integer
stepssteps0 to 100000, integer
sitting_breakscount0 to 48, integer
hydration_glassesglasses0 to 20, integer
meals_countcount0 to 10, integer
fruit_veg_portionsportions0 to 30, integer
caffeine_drinkscount0 to 20, integer
mood_level · stress_levelrating_1_51 to 5, integer (self-reported)
biomarkersheart_ratebpm20 to 250
resting_heart_ratebpm20 to 200
hrv_rmssdms1 to 500
weightkg1 to 400
waist_circumferencecm20 to 300
heightcm30 to 260

Your own measures live in custom layers defined by layer schemas (Beta, v1.1): POST /v1/schemas with a layer name and its measures (name, type, unit, accepted bounds, enum values, or an expression for a derived measure). A schema is never changed: posting the same layer again creates its next version, and a twin keeps the version it was created with (POST /v1/twins with schemas). Every measure of a twin is addressed as layer.measure and listed by GET /v1/twins/{id}/measures. Built-in layers other than wellness and biomarkers, such as laboratory values or body composition, are not part of the API.

Observations Beta#

An observation is one value of one kind at one time. A line has exactly these four fields; any other field is refused, so nothing else, such as a name, can ride along:

{ "kind": "steps", "value": 8432, "unit": "steps", "observed_at": "2026-11-18T21:00:00Z" }

You send up to 500 lines per batch to POST /v1/twins/{id}/observations. Each line is checked on its own, in this order, and the first failure is its reason:

reasonMeaning
line_not_an_objectThe line is not a JSON object.
identifier_field_not_acceptedA field named like an identifier, such as email or full_name.
unknown_fieldAny other field beyond the four.
unknown_kindThe kind is not in the catalogue.
layer_not_enabled_on_twinThe kind belongs to a layer the twin does not have; expected names the layer.
unit_mismatchMissing unit or not the kind's unit; expected gives it. Nothing is ever converted.
value_not_a_numberMissing value, or text instead of a number.
value_not_an_integerA decimal for an integer kind.
value_out_of_accepted_boundsOutside the accepted bounds; expected is [min, max].
timestamp_invalidobserved_at missing or not RFC 3339 with an offset (Z or ±hh:mm).
timestamp_out_of_rangeIn the future (beyond five minutes) or before 2000.
duplicate_in_batchThe same kind and time twice in one batch.
duplicate_observationThe same kind and time is already stored: refused, never overwritten.
twin_observation_limit_reachedThe twin holds the maximum number of observations.

A rejected line is never stored, not even in part; it comes back with its index (from 0), reason and, where it helps, field and expected. The valid lines of the batch are stored together. The answer is 200 when at least one line was accepted and 422 when none was, with the same body: batch_id, accepted, rejected and recomputed_layers. Because a repeated kind and time is refused as duplicate_observation, resending a batch after a network error never stores anything twice.

GET /v1/twins/{id}/observations returns the series in time order, filtered by kind, from (inclusive) and to (exclusive), up to limit (1000 by default, 5000 at most).

Recompute Beta#

The layers touched by a batch are recomputed before the answer; there is no separate call. Per kind, the layer keeps descriptive values only: count, latest (value and time), min, max, mean, mean_last_7_days (the mean of the 7 days that end at the kind's latest observation), first_observed_at and last_observed_at. A kind without observations has count 0 and null everywhere else. There are no scores, no labels such as normal, high or low, and no clinical reading.

Query and export Beta#

Read a layer with GET /v1/twins/{id}/layers/{layer}. Export a twin with GET /v1/twins/{id}/export: one JSON document ("format": "starco-dev-export/v1", with the twin, its layers and all its observations) and the header X-Content-SHA256, the fingerprint: the SHA-256 of exactly the bytes of the body. Anyone holding the file can recompute the hash and check that it has not changed. The fingerprint is also written to the audit chain.

Erasure Beta#

DELETE /v1/twins/{id} erases a twin with its observations and layers and returns a receipt: twin_id, erased_at, observations_erased, layers_erased and content_sha256, the SHA-256 of the twin's export right before erasure. Nothing of the twin is kept but that receipt, in the audit chain. DELETE /v1/account erases everything of an account and returns projects_erased, twins_erased and erased_at. Erasing a single project, backups and restore are Coming.

Audit chain Beta#

Every request made with a key, including the refusals of a known key, and every console action on a project is a row of that project's audit chain: seq, actor_type (key, console or system), actor_ref (the key prefix or the account id, never a secret), action (such as twins.store, observations.store, layers.show, key.created), resource_type, resource_id, http_status, detail (counts and ids, never an observation value) and created_at. Each row stores prev_hash, the hash of the row before (64 zeros for the first), and its own row_hash:

row_hash = SHA-256( "starco-dev-audit/v1\n" + project_id + "\n" + seq + "\n" + prev_hash + "\n"
                    + "seq=<bytes>:<value>\n" + "actor_type=<bytes>:<value>\n" + … + "created_at=<bytes>:<value>" )
# fields in this order: seq, actor_type, actor_ref, action, resource_type, resource_id, http_status, detail, created_at
# a null field is written "field=~"; <bytes> is the UTF-8 length of the value

If anyone edited or removed a row, its hash or every link after it would stop matching. GET /v1/audit returns the rows with everything the hash covers, so you can recompute the chain without any secret; GET /v1/audit/verify walks it on the server and names the first broken row and why. The tutorial Verify the audit chain does it in Python. The chain is tamper-evident, not tamper-proof: keep your own copy of the head from time to time.

Errors and limits Beta#

Every error has the same shape and a stable code you can program against:

{ "success": false, "code": "insufficient_scope", "error": "This project key does not have the scope this endpoint needs.", "needs": "read" }

Extra fields help where they can: field, expected, needs, errors, limit. Limits per project: 60 requests a minute by default (up to 600), 200 twins, 10 active keys, 500 lines per batch (413 batch_too_large above that) and 100,000 observations per twin; per account, 5 projects. Sign-up and sign-in are limited per IP address.

MCP Beta#

The Model Context Protocol lets an AI assistant call tools. Each synthetic project has a STARCO MCP server: six read tools over its twins, with starco_dm_ tokens that expire after one hour, cannot call the REST API and never reach another project. Every MCP request is a row of the audit chain, and every answer an assistant gives from it must be labelled as AI. Read the MCP server page.

Illustrative scenarios Experimental#

An illustrative scenario describes one twin's own history moved by a change you declare. It is not a prediction. GET /v1/twins/{twin}/scenarios/{measure}?declared_change=0.5 (scope read) works on the series of a numeric measure, built in or of your own layer, and is computed on STARCO's servers; it stores nothing. It takes the days of that twin that have a value inside a window (28 days unless you send window_days, from 14 to 90; to sets the last UTC day, today by default), describes them as a baseline (mean, min, max, P25, median, P75) and moves their middle half by your change (scenario.band and scenario.center), kept inside the accepted bounds of the measure. A day's value is the mean of its observations.

Eight synthetic nights of wellness.sleep_hours (6.5, 7, 7.25, 7.5, 7.75, 8, 8.5, 6), declared_change=0.5, to=2026-11-10illustrative · synthetic
{
  "twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e3f",
  "measure": "wellness.sleep_hours",
  "unit": "h",
  "experimental": true,
  "kind": "illustrative_scenario",
  "label": "Illustrative scenario, not a prediction",
  "data_class": "synthetic",
  "window": {"from": "2026-10-14", "to": "2026-11-10", "days": 28},
  "minimum_days": 7,
  "days_observed": 8,
  "days_without_value": 20,
  "accepted_min": 0,
  "accepted_max": 24,
  "reason": null,
  "baseline": {"mean": 7.31, "min": 6, "max": 8.5, "p25": 6.88, "median": 7.38, "p75": 7.81},
  "scenario": {"declared_change": 0.5, "center": 7.88, "band": {"low": 7.38, "high": 8.31}, "clamped_to_accepted_bounds": false},
  "method": "Experimental, hosted by STARCO. A day is a UTC day, and its value is the mean of the observations of the measure on that day. …",
  "input_sha256": "d63d7977ecd7f4af170ec2fe11df76ebc866b6fb9dc609d01b0ef77303fe9737",
  "result_sha256": "dd1aa9e26513933db7c006db6a331461bd9dbf48ff5e16eb777e300042ac7960"
}

With fewer than 7 days with a value in the window, baseline and scenario are null and reason is not_enough_days: never zero, never a typical value. A measure without a series (an enum, a text, a derived measure) answers 422 measure_has_no_series.

input_sha256 and result_sha256 are the fingerprints of what was read and of what was answered.

What it does not do: it reads no other twin and no reference range, and it gives no score, no interpretation and no health outcome. The band says where the middle half of this twin's own days would sit if every day moved by the number you typed; it says nothing about whether that change would happen or what it would cause. The same series and the same change always give the same answer, and every answer carries a summary of the method in words (method).

ExperimentalThe operation works as described over synthetic data and is answered by the simulated sandbox of this site with the same figures. Its fields can still change and it can be withdrawn; the changelog will say so.

Statistical fits Experimental#

A statistical fit is regression, plain curve fitting: a curve fitted by least squares to one twin's own daily series, so that you can see it drawn, compare several curves and estimate values from the one you choose. GET /v1/twins/{twin}/fits/{measure}?model=linear (scope read) works on the series of a numeric measure, built in or of your own layer, and is computed on STARCO's servers; it stores nothing. It takes the days of that twin that have a value inside a window (28 days unless you send window_days, from 14 to 90; to sets the last UTC day, today by default); a day's value is the mean of its observations. The predictor x is time, the day number in the window (1 for its first day), unless you name another measure.

modelformleast squares onneeds
lineary = b0 + b1 * xy
quadraticy = b0 + b1 * x + b2 * x^2y
cubicy = b0 + b1 * x + b2 * x^2 + b3 * x^3y
exponentialy = a * exp(b * x)ln yevery y above 0
logarithmicy = a + b * ln(x)yevery x above 0
powery = a * x^bln yevery x and every y above 0
Seven synthetic nights of wellness.sleep_hours (5, 6.5, 5.5, 6.5, 7, 8, 7), model=linear, horizon_days=2, to=2026-11-10illustrative · synthetic
{
  "twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e3f",
  "measure": "wellness.sleep_hours",
  "unit": "h",
  "experimental": true,
  "kind": "statistical_fit",
  "label": "Experimental. A statistical fit of this twin's own series: an extrapolation, not a health prediction.",
  "data_class": "synthetic",
  "window": {"from": "2026-10-14", "to": "2026-11-10", "days": 28},
  "predictors": [{"kind": "time", "measure": null, "unit": "day"}],
  "model": "linear",
  "horizon_days": 2,
  "minimum_days": 7,
  "days_observed": 7,
  "days_without_value": 21,
  "accepted_min": 0,
  "accepted_max": 24,
  "reason": null,
  "points": [
    {"day": "2026-11-04", "x": [22], "y": 5},
    {"day": "2026-11-05", "x": [23], "y": 6.5},
    {"day": "2026-11-06", "x": [24], "y": 5.5},
    {"day": "2026-11-07", "x": [25], "y": 6.5},
    {"day": "2026-11-08", "x": [26], "y": 7},
    {"day": "2026-11-09", "x": [27], "y": 8},
    {"day": "2026-11-10", "x": [28], "y": 7}
  ],
  "fits": [
    {
      "model": "linear",
      "form": "y = b0 + b1 * x",
      "fitted_in": "y",
      "reason": null,
      "coefficients": {"b0": -2.875, "b1": 0.375},
      "statistics": {"n": 7, "parameters": 2, "degrees_of_freedom": 5, "r_squared": 0.65625, "adjusted_r_squared": 0.5875, "residual_standard_error": 0.642262, "rmse_original_scale": 0.54281},
      "interval": {"level": 0.95, "t_quantile": 2.57058, "degrees_of_freedom": 5},
      "fitted": [5.375, 5.75, 6.125, 6.5, 6.875, 7.25, 7.625],
      "estimates": [
        {"day": "2026-11-11", "x": [29], "estimate": 8, "interval": {"lower": 5.83835, "upper": 10.1616}, "reason": null, "extrapolated": true, "outside_accepted_bounds": false},
        {"day": "2026-11-12", "x": [30], "estimate": 8.375, "interval": {"lower": 6.0194, "upper": 10.7306}, "reason": null, "extrapolated": true, "outside_accepted_bounds": false}
      ]
    }
  ],
  "method": "Experimental, hosted by STARCO. Each model is fitted by ordinary least squares to the days of this twin that have a value in the window …",
  "input_sha256": "4634d029ec5c22b7d78751ca5c209ce548fe2b27d49ab191d001f41bf8d8f55d",
  "result_sha256": "8d14aedddf913e31d0071129dbdc38f81066e69e5e8f4ed87a67865a101f531d"
}

You choose the model; STARCO does not. model=all returns the six fits side by side, always in the same order (linear, quadratic, cubic, exponential, logarithmic, power). That order is not a ranking, and no field of the answer marks a model as preferable or recommends one: which curve describes your series is a decision for the researcher, who knows what the measure is and how it was collected. Each fit carries what you need to decide: its coefficients, n, the number of parameters, the degrees_of_freedom, r_squared, adjusted_r_squared, the residual_standard_error and rmse_original_scale, and the fitted value of every day so that you can draw the curve over your points. Read them with care: a model with more parameters never has a smaller R², and for exponential and power, which are fitted to ln y ("fitted_in": "ln_y"), R², adjusted R² and the residual standard error refer to ln y and cannot be set against those of a model fitted to y. rmse_original_scale is in the unit of the measure for the six.

A chart of a synthetic series: 26 days with a value of wellness.steps inside a window of 28 days (2 days have no value and are left empty), from 2026-10-22 to 2026-11-18. Each day is a point. Over the points runs the fitted curve of one model, with a thin line from each point to the curve (its residual), continued for 7 days after the window as a dashed line inside a band, its 95 % prediction interval. Six buttons under the chart change the model drawn: linear, quadratic, cubic, exponential, logarithmic, power. A marker travels along the curve and reads the day and the estimate. The table under the chart gives the fit statistics of the six models side by side, in that fixed order, which is not a ranking: linear, R² 0.80684, RMSE 612.662 steps; quadratic, R² 0.967187, RMSE 252.516 steps; cubic, R² 0.977139, RMSE 210.771 steps; exponential, R² 0.751735 of ln y, RMSE 717.349 steps; logarithmic, R² 0.959927, RMSE 279.055 steps; power, R² 0.960025 of ln y, RMSE 309.853 steps. The figure does not choose a model, and neither does STARCO: that is the researcher's decision.

Six curves, one series. Pick the model that is drawn; the statistics of the six stay side by side in the table, in the fixed order of the API. Neither the figure nor STARCO ranks them or marks one as preferable: choosing is yours. Every number is the answer of the simulator to GET /v1/twins/{twin}/fits/{measure}?model=all&horizon_days=7 for this synthetic series.

Fit statistics of the six models for this synthetic series, in the fixed order of the API (not a ranking)
modelformfitted inR²adjusted R²residual SERMSE (steps)ndf
lineary = b0 + b1 * xy0.806840.798792637.679612.6622624
quadraticy = b0 + b1 * x + b2 * x^2y0.9671870.964333268.48252.5162623
cubicy = b0 + b1 * x + b2 * x^2 + b3 * x^3y0.9771390.974021229.133210.7712622
exponentialy = a * exp(b * x)ln y0.7517350.7413910.103197717.3492624
logarithmicy = a + b * ln(x)y0.9599270.958257290.45279.0552624
powery = a * x^bln y0.9600250.9583590.04141309.8532624

Synthetic series · answered by the simulator

Estimates. With time as the predictor, horizon_days (0 by default, at most half the window) adds an estimate for each of the days after the window. Each comes with a 95 % prediction interval for one new value, estimate ± t · s · √(1 + h), where s is the residual standard error, h the leverage of that day and t the 0.975 quantile of Student's t; the answer states the quantile and its degrees of freedom (interval.t_quantile, interval.degrees_of_freedom). For the two models fitted to ln y the interval is computed for ln y and its ends are exponentiated, and the estimate is the exponential of the fitted ln y. The interval assumes independent errors of constant variance that follow a Gaussian distribution; the API does not check that, and a curve can fit the window and still be wrong the day after. An estimate is never clamped: if it leaves the accepted bounds of the measure it is returned as computed with "outside_accepted_bounds": true.

Other predictors. x=wellness.steps fits the measure against another numeric measure of the same twin instead of time: a point is then a day on which both have a value. With model=linear, x accepts up to three measures separated by commas, which is multiple linear regression (y = b0 + b1 * x1 + b2 * x2 + b3 * x3). at lists the predictor values to estimate at, for example at=6000;9500, or at=6000,7.5;9500,8 with two predictors; "extrapolated": true marks a value outside those observed in the window.

Null with a reason. With fewer than 7 days, points and fits are null and reason is not_enough_days: never zero, never a typical value. A model that is not defined for your series keeps its place in the list with every figure null and its own reason: values_not_positive, predictor_not_positive, constant_series, singular_system (a predictor that does not vary, predictors that repeat one another, or too few distinct values for the degree), not_enough_points or not_finite. A measure without a series answers 422 measure_has_no_series.

input_sha256 and result_sha256 are the fingerprints of what was read and of what was answered.

What it does not do: it reads no other twin and no reference range, and it gives no score, no interpretation and no health outcome. Every answer is labelled «Experimental. A statistical fit of this twin's own series: an extrapolation, not a health prediction.» The same series and the same parameters always give the same answer, and every answer carries a summary of the method in words (method).

ExperimentalThe operation works as described over synthetic data and is answered by the simulated sandbox of this site with the same figures. Its fields can still change and it can be withdrawn; the changelog will say so.

Cohort summaries Experimental#

A cohort summary describes one numeric measure across the twins of your project. GET /v1/cohort/{measure} (scope read) is computed on STARCO's servers; it stores nothing. For each twin it counts the days of a window that have a value (days_observed) and gives the mean of those daily values; for the cohort it describes those per-twin means (distribution: minimum, P25, median, P75, maximum and mean) and counts them in bins of equal width (histogram.bins), ready to draw. The window is the one of the scenarios: 28 days unless you send window_days (14 to 90), ending on to (today by default); a day's value is the mean of its observations. bins sets the number of bins (8 unless you say, 1 to 20).

Which twins it reads. This is the one experimental operation that reads several twins: the twins of the project of your key, and never a twin of another project. origin=api keeps only the twins you created through POST /v1/twins, origin=synthetic_cohort only the sample twins the project came with; without it, all of them. A call reads at most 200 twins, the largest page of GET /v1/twins: a selection of more than 200 is refused with 422 cohort_too_large, never summarised in part.

Six synthetic twins with a week of wellness.steps each, origin=api, window_days=14, to=2026-11-10illustrative · synthetic
{
  "project_id": "3d5e0b1a-9c42-4f7e-8a16-5b2c7d9e0f31",
  "measure": "wellness.steps",
  "unit": "steps",
  "experimental": true,
  "kind": "cohort_summary",
  "label": "Experimental. A description of the twins of this project, in the order they were created: not a ranking, not a reference range and not a health assessment.",
  "data_class": "synthetic",
  "window": {"from": "2026-10-28", "to": "2026-11-10", "days": 14},
  "minimum_days": 7,
  "selection": {"origin": "api", "twins": 6, "max_twins": 200},
  "twins": [
    {"twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e01", "label": "p-01", "days_observed": 7, "mean": 7945.71, "reason": null},
    {"twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e02", "label": "p-02", "days_observed": 7, "mean": 7314.29, "reason": null},
    {"twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e03", "label": "p-03", "days_observed": 7, "mean": 10312.86, "reason": null},
    {"twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e04", "label": "p-04", "days_observed": 7, "mean": 5681.43, "reason": null},
    {"twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e05", "label": "p-05", "days_observed": 7, "mean": 8821.43, "reason": null},
    {"twin_id": "7c1f0a52-3b9e-4d1a-9e6f-2a4b8c0d1e06", "label": "p-06", "days_observed": 7, "mean": 7317.14, "reason": null}
  ],
  "twins_with_value": 6,
  "reason": null,
  "distribution": {"min": 5681.43, "p25": 7315, "median": 7631.43, "p75": 8602.5, "max": 10312.86, "mean": 7898.81},
  "histogram": {"bins": [
    {"from": 5681.43, "to": 6260.36, "count": 1},
    {"from": 6260.36, "to": 6839.29, "count": 0},
    {"from": 6839.29, "to": 7418.22, "count": 2},
    {"from": 7418.22, "to": 7997.15, "count": 1},
    {"from": 7997.15, "to": 8576.07, "count": 0},
    {"from": 8576.07, "to": 9155, "count": 1},
    {"from": 9155, "to": 9733.93, "count": 0},
    {"from": 9733.93, "to": 10312.86, "count": 1}
  ]},
  "method": "Experimental, hosted by STARCO. It reads the twins of the project of the key (with origin, only those created that way), at most 200 in a call, and no twin of any other project; …",
  "input_sha256": "733648814fc4ee00ced1e5a9013387863bc057d71e0d427a8f3bd2a70e2cbe22",
  "result_sha256": "6b23c3cc8070d511dd4949c4d749f1ba6a4fcbb0f2b21f5540a8cdedea39b4a3"
}

You can compute the cohort figures again. The distribution and the histogram are computed from the means of the rows of twins exactly as the answer shows them, to two decimals. A twin is counted in bin floor((mean − min) ÷ (max − min) × bins), counted from 0 and computed in double precision; the maximum falls in the last bin, the edges are shown to two decimals, and when every mean is the same there is one bin.

Null with a reason. A twin with fewer than 7 days with a value has a null mean and the reason not_enough_days: never zero, never a typical value. A twin that does not have the measure has null days and mean and the reason measure_not_in_twin; one whose layer schema defines it with another unit or without a series, measure_differs. When no twin has a mean, distribution and histogram are null and reason is no_twin_with_a_value. When no twin of the selection has the measure at all, the answer is 404 unknown_measure.

What it does not do: it does not rank the twins, which come in the order they were created, it flags none of them and it compares none with the rest. The distribution is your project's own data and not a reference range. It gives no score, no interpretation and no health outcome, and it predicts nothing. The same data and the same parameters always give the same answer, and every answer carries a summary of the method in words (method). input_sha256 and result_sha256 are its fingerprints.

ExperimentalThe operation works as described over synthetic data and is answered by the simulated sandbox of this site with the same figures. Its fields can still change and it can be withdrawn; the changelog will say so.

Fingerprints of a computed result Experimental#

The answers of the three experimental operations (scenarios, fits and cohort summaries) carry two fingerprints. input_sha256 is the SHA-256 of what the computation read and was asked: the daily values, the window, the measure and the parameters. result_sha256 is the SHA-256 of what it answered. The audit row of the call (scenarios.show, fits.show, cohort.show) holds result_sha256 in its detail, so the audit chain of the project attests that this result was given at that time, with that key. The row holds the fingerprint and no value.

Neither fingerprint covers the id of a twin or of a project: the same data gives the same two fingerprints whatever the twin, and the audit row says which twin or project it was. A fingerprint tells whether two inputs or two results are the same. It is not a signature, and it says nothing about whether a result is right.

The canonical text

Each fingerprint is the SHA-256, in lowercase hexadecimal, of the UTF-8 bytes of a text that anyone holding the same data can write again. It is JSON written one way only:

  • no whitespace; the keys of an object sorted by their bytes (every key is ASCII); a list in its own order;
  • null, true and false as JSON writes them; a string as JSON writes it, escaping only ", \ and the control characters;
  • a number is never written as a JSON number: it is a string with its plain decimal expansion. An optional -, the whole part without leading zeros and, only when there is one, a point and the decimals without trailing zeros. No exponent and no +; zero is "0". The digits are those of the shortest decimal that reads back as the same double, which is what JavaScript's String(x) and Python's repr(x) print: 7.0 is "7", 0.50 is "0.5", 1e-7 is "0.0000001".

We chose strings in one fixed format, and not floating-point numbers, because two languages print the same number in different ways (7.0 and 7, 1e-07 and 1.0e-7) and a fingerprint must not depend on that.

The result is the object {"format": "starco-dev-result/v1", "operation": …} plus these fields of the answer, exactly as the answer has them:

operation"operation"fields of the answer
scenarioscenariomeasure, unit, window, days_observed, reason, baseline, scenario
fitsfitmeasure, unit, window, predictors, model, horizon_days, days_observed, reason, points, fits
cohort summarycohortmeasure, unit, window, twins, twins_with_value, reason, distribution, histogram; from each row of twins only days_observed, mean, reason, and the rows sorted by the bytes of their own canonical text

The input is the object {"format": "starco-dev-input/v1", "operation", "measure", "unit", "window", "parameters", …}. A scenario and a fit add accepted_min, accepted_max and series: a list of {"measure", "days"} with the measure itself first and then, for a fit, each predictor in the order of x. days lists every day of the window that has a value, oldest first, as ["2026-11-03", "7.25"]. The parameters of a scenario are {"declared_change"}; those of a fit, {"model", "x", "horizon_days", "at"}, where x is the list of the predictor names (empty for time) and at the list of the points asked for, each a list of numbers (empty when there is none). A cohort summary has the parameters {"bins", "origin"} and, instead of series, twins: the days list of each twin read (null for a twin that does not have the measure), sorted by the bytes of their own canonical text.

The value of a day is the mean of its observations in double precision, added in the order of their time; it is rounded to 6 decimals, half away from zero, on its shortest decimal (a decimal operation on the digits, so that 3.0000005 is "3.000001"), and then written like any other number.

A worked example

The scenario above: eight nights, declared_change=0.5, to=2026-11-10. These are its two texts (each is one line; they are wrapped here to fit the page):

The canonical text of the inputillustrative · synthetic
{"accepted_max":"24","accepted_min":"0","format":"starco-dev-input/v1","measure":"wellness.sleep_hours",
"operation":"scenario","parameters":{"declared_change":"0.5"},"series":[{"days":[["2026-11-03","6.5"],
["2026-11-04","7"],["2026-11-05","7.25"],["2026-11-06","7.5"],["2026-11-07","7.75"],["2026-11-08","8"],
["2026-11-09","8.5"],["2026-11-10","6"]],"measure":"wellness.sleep_hours"}],"unit":"h",
"window":{"days":"28","from":"2026-10-14","to":"2026-11-10"}}
The canonical text of the resultillustrative · synthetic
{"baseline":{"max":"8.5","mean":"7.31","median":"7.38","min":"6","p25":"6.88","p75":"7.81"},"days_observed":"8",
"format":"starco-dev-result/v1","measure":"wellness.sleep_hours","operation":"scenario","reason":null,
"scenario":{"band":{"high":"8.31","low":"7.38"},"center":"7.88","clamped_to_accepted_bounds":false,
"declared_change":"0.5"},"unit":"h","window":{"days":"28","from":"2026-10-14","to":"2026-11-10"}}
Their SHA-256: the two fingerprints of that answerillustrative · synthetic
input_sha256   d63d7977ecd7f4af170ec2fe11df76ebc866b6fb9dc609d01b0ef77303fe9737
result_sha256  dd1aa9e26513933db7c006db6a331461bd9dbf48ff5e16eb777e300042ac7960

Verify it yourself

Save the answer and the audit rows of the project, and check both without asking STARCO anything else. The first program recomputes the fingerprint of the result from the answer you hold and looks for it in the audit rows; the second writes the input of a scenario from your own observations. Both use the Python standard library only.

export API="https://api.starco.dev/v1"
AUTH="Authorization: Bearer $STARCO_KEY"
curl -s "$API/twins/$TWIN/scenarios/wellness.sleep_hours?declared_change=0.5&to=2026-11-10" -H "$AUTH" -o answer.json
curl -s "$API/audit?limit=1000" -H "$AUTH" -o audit.json
python3 verify_result.py answer.json audit.json
import hashlib, json, sys
from decimal import Decimal

FIELDS = {
    "scenario": ["measure", "unit", "window", "days_observed", "reason", "baseline", "scenario"],
    "fit": ["measure", "unit", "window", "predictors", "model", "horizon_days", "days_observed", "reason", "points", "fits"],
    "cohort": ["measure", "unit", "window", "twins", "twins_with_value", "reason", "distribution", "histogram"],
}
KINDS = {"illustrative_scenario": "scenario", "statistical_fit": "fit", "cohort_summary": "cohort"}

def plain(x):                                    # a number as the canonical text writes it
    s = format(Decimal(repr(x)), "f")
    if "." in s:
        s = s.rstrip("0").rstrip(".")
    return "0" if s in ("-0", "") else s

def stringed(v):                                 # every number becomes a string; nothing else changes
    if v is None or isinstance(v, (bool, str)):
        return v
    if isinstance(v, (int, float)):
        return plain(v)
    if isinstance(v, list):
        return [stringed(x) for x in v]
    return {k: stringed(x) for k, x in v.items()}

def canonical(v):
    return json.dumps(stringed(v), sort_keys=True, separators=(",", ":"), ensure_ascii=False)

def result_sha256(answer):
    operation = KINDS[answer["kind"]]
    result = {k: answer[k] for k in FIELDS[operation]}
    if operation == "cohort":                    # no ids, and no order of the twins
        rows = [{k: row[k] for k in ("days_observed", "mean", "reason")} for row in result["twins"]]
        result["twins"] = sorted(rows, key=lambda row: canonical(row).encode())
    result.update(format="starco-dev-result/v1", operation=operation)
    return hashlib.sha256(canonical(result).encode()).hexdigest()

answer = json.load(open(sys.argv[1]))
mine = result_sha256(answer)
assert mine == answer["result_sha256"], "this is not the result that was fingerprinted"
print("result ok:", mine)

if len(sys.argv) > 2:                            # the row of that call in the audit chain holds the same fingerprint
    rows = [r for r in json.load(open(sys.argv[2]))["data"] if r["detail"] and json.loads(r["detail"]).get("result_sha256") == mine]
    assert rows, "no audit row holds this fingerprint"
    print("attested by audit row", rows[0]["seq"], rows[0]["action"], "at", rows[0]["created_at"])
import hashlib, json
from decimal import ROUND_HALF_UP, Decimal

def plain(x, decimals=None):                     # with decimals: rounded first, half away from zero, in decimal
    d = Decimal(repr(x))
    if decimals is not None:
        d = d.copy_abs().quantize(Decimal(1).scaleb(-decimals), rounding=ROUND_HALF_UP).copy_sign(d)
    s = format(d, "f")
    if "." in s:
        s = s.rstrip("0").rstrip(".")
    return "0" if s in ("-0", "") else s

def days(observations, first, last):             # [(observed_at "2026-11-03T07:00:00Z", value)] → [["2026-11-03", "6.5"], …]
    per = {}
    for at, value in sorted(observations):       # in the order of their time
        if first <= at[:10] <= last:
            per.setdefault(at[:10], []).append(value)
    out = []
    for day in sorted(per):
        total = 0.0
        for value in per[day]:
            total += value
        out.append([day, plain(total / len(per[day]), 6)])
    return out

observations = [("2026-11-03T07:00:00Z", 6.5), ("2026-11-04T07:00:00Z", 7), ("2026-11-05T07:00:00Z", 7.25), ("2026-11-06T07:00:00Z", 7.5),
                ("2026-11-07T07:00:00Z", 7.75), ("2026-11-08T07:00:00Z", 8), ("2026-11-09T07:00:00Z", 8.5), ("2026-11-10T07:00:00Z", 6)]
text = json.dumps({
    "format": "starco-dev-input/v1", "operation": "scenario", "measure": "wellness.sleep_hours", "unit": "h",
    "window": {"from": "2026-10-14", "to": "2026-11-10", "days": "28"}, "accepted_min": "0", "accepted_max": "24",
    "parameters": {"declared_change": plain(0.5)},
    "series": [{"measure": "wellness.sleep_hours", "days": days(observations, "2026-10-14", "2026-11-10")}],
}, sort_keys=True, separators=(",", ":"), ensure_ascii=False)
print(hashlib.sha256(text.encode()).hexdigest())  # d63d7977ecd7f4af170ec2fe11df76ebc866b6fb9dc609d01b0ef77303fe9737

If the first program prints result ok, the figures you hold are the ones the fingerprint was taken of; if it also finds the audit row, the chain of your project records that this result was given, when and with which key, and recomputing the chain shows that no row was changed since. Keep the answer, or only its fingerprint, wherever you decide: the check needs nothing from us but the audit rows.

ExperimentalThe fingerprints are part of the three experimental operations: the canonical text is versioned (starco-dev-input/v1, starco-dev-result/v1), and a change of it would be a new version announced in the changelog. In the simulated sandbox of this site they are computed in your browser with the same rule, and are null where the browser cannot hash (a page not served over HTTPS).

Coming later Coming#

custom measures
Your own typed measures with a unit and bounds, defined in a versioned layer schema; derived measures are calculated from others of the same layer (v1.1).
planning scenarios and jobs
Beyond the illustrative scenario of one measure of one twin: planning questions on the state of a twin or a cohort, and hosted analysis jobs, with their assumptions and model version kept. Planning only: not forecasts about a person and not for clinical use.
consent and subjects
When an organisation works with real people under a contract: pseudonymous subjects, consent per purpose with version and date, withdrawal that stops every share based on it.
where a result is kept
Today a computed result can be written into a twin (its state, with versions and history) and taken out in an export that you keep wherever you decide, each checkable by its fingerprint. Later: a STARCO node inside your institution, and a Solid pod. Neither exists today, and nothing here connects to a Solid pod.
placement
Where a project lives: STARCO Cloud in the European Union today; a dedicated cloud, a private node in your network, a Simbionical™ Nexus at home or a Solid pod that the person controls, later. Same API everywhere.
backups
Encrypted snapshots per project and restore to a point in time.
tooling
SDKs, a CLI, webhooks, a status page, email verification and password recovery.

Statuses#

Available
Open to everyone, with no account: this documentation and the simulated playground.
Beta
Built, tested and running over synthetic data, documented as it is, and offered to every developer account. It is a beta: details can still change, and the changelog says so when they do.
Beta · in development
Being built now. The design shown can change and there is nothing to call yet.
Experimental
Built, tested and answering over synthetic data as documented, and still an experiment: its fields can change and it can be withdrawn. Today: illustrative scenarios, statistical fits and cohort summaries, with their fingerprints.
Coming
Planned, not built. We do not offer it until it works.

Every call needs a developer account, which is free: sign up. The statuses tell you what each part of the platform does today.