Your first call in five minutes.
Create an account, verify your email, sign in, create a project and a key, create a synthetic twin, send it one observation, read the recomputed layer and see your calls in the audit chain.
STEP 1 Create an account and verify your email Beta#
Read the version of the developer terms in force and accept exactly that version when you sign up; it is stored with your account. Passwords need 12 characters or more and common passwords are refused. Keep yours in the environment variable STARCO_PASSWORD (for example with read -s STARCO_PASSWORD; export STARCO_PASSWORD), so it never appears in a command line or in your code. The curl lines use jq to read the fields they need.
export API="https://api.starco.dev/v1"
V=$(curl -s "$API/terms" | jq -r .version)
curl -s -X POST "$API/accounts" -H "Content-Type: application/json" \
-d "{\"email\": \"dev@example.test\", \"password\": \"$STARCO_PASSWORD\", \"accept_terms_version\": \"$V\"}"import os, requests
API = "https://api.starco.dev/v1"
version = requests.get(f"{API}/terms").json()["version"]
r = requests.post(f"{API}/accounts", json={
"email": "dev@example.test", "password": os.environ["STARCO_PASSWORD"], "accept_terms_version": version})
print(r.status_code, r.json())// signup.mjs: run it once, then open the link of the message
import { Client } from '@starco/sdk';
const c = new Client({ baseUrl: "https://api.starco.dev/v1" });
const { version } = await c.accounts.terms(); // read the terms: you accept exactly this version
const receipt = await c.accounts.register("dev@example.test", process.env.STARCO_PASSWORD, version);
console.log(receipt);starco --base-url https://api.starco.dev/v1 terms # read them: you accept exactly the version they print
V=$(starco --base-url https://api.starco.dev/v1 --json terms | jq -r .version)
starco register --base-url https://api.starco.dev/v1 --email dev@example.test --accept-terms $V # password from $STARCO_PASSWORD, or asked202 { "status": "verification_required", "expires_in_minutes": 1440,
"note": "A message was sent to the address. Verify it with the link or token of the message (POST /v1/accounts/verify) and then sign in with POST /v1/sessions. If the address already had an account, the message says so and nothing changed." }The answer is the same whether or not the address already had an account. Another terms version answers 422 terms_version_mismatch with the expected one.
Verify your email
The message has a link that works once, for 24 hours. Open it: that is all, and it is what the Python and TypeScript tabs assume you did. With the API alone or the command line, the link ends in #token=…: keep that token in STARCO_VERIFY_TOKEN and send it (in the SDKs, accounts.verify(token)).
curl -s -X POST "$API/accounts/verify" -H "Content-Type: application/json" \
-d "{\"token\": \"$STARCO_VERIFY_TOKEN\"}"echo "$STARCO_VERIFY_TOKEN" | starco verify-email # the token is read from standard input, never printed or saved{ "verified": true, "note": "Sign in with POST /v1/sessions." }Until the address is verified, signing in answers exactly like a wrong password. A forgotten password is reset with POST /v1/password/forgot and POST /v1/password/reset.
STEP 2 Sign in and create a project Beta#
Signing in gives a console token (starco_dc_…) valid for 12 hours, shown once. It manages your account, projects and keys; it cannot read twins. The curl lines keep it in STARCO_CONSOLE and the Python lines in console; later guides use those names. A new project comes with a cohort of 8 synthetic twins, each with the 14 days that end yesterday.
export STARCO_CONSOLE=$(curl -s -X POST "$API/sessions" -H "Content-Type: application/json" \
-d "{\"email\": \"dev@example.test\", \"password\": \"$STARCO_PASSWORD\"}" | jq -r .token)
PROJECT=$(curl -s -X POST "$API/projects" -H "Authorization: Bearer $STARCO_CONSOLE" -H "Content-Type: application/json" \
-d '{"name": "Quickstart"}' | jq -r .project.id)
echo "$PROJECT"console = requests.post(f"{API}/sessions", json={
"email": "dev@example.test", "password": os.environ["STARCO_PASSWORD"]}).json()["token"]
C = {"Authorization": f"Bearer {console}"}
project = requests.post(f"{API}/projects", headers=C, json={"name": "Quickstart"}).json()["project"]
print(project["id"], project["twin_count"])import { Client } from '@starco/sdk';
const c = new Client({ baseUrl: "https://api.starco.dev/v1" });
await c.accounts.login("dev@example.test", process.env.STARCO_PASSWORD); // keeps the console token in the client
const project = await c.projects.create("Quickstart");
console.log(project.id, project.twin_count);starco login --base-url https://api.starco.dev/v1 --email dev@example.test # password from $STARCO_PASSWORD, or asked
PROJECT=$(starco --json projects create "Quickstart" | jq -r .id)
starco projects use $PROJECT # the default project of the next commands{ "project": { "id": "0b7e4c1a-5d2f-4e8a-9c3b-7f1e2d6a8b90", "name": "Quickstart",
"data_class": "synthetic", "rate_limit_per_minute": 60, "twin_count": 8,
"audit_head": { "seq": 2, "hash": "5f0c…a41e" }, "created_at": "2026-11-19T15:39:40Z" } }The audit chain already has two rows: project.created and cohort.generated. In the CLI tab of the next steps, <twin> is the id that creating the twin prints.
STEP 3 Create a key Beta#
Project keys (starco_dk_…) have scopes and an expiry. read reads, write creates, sends and erases; write does not include read, so ask for both here. ttl_days is 30 by default and 90 at most.
RESP=$(curl -s -X POST "$API/projects/$PROJECT/keys" -H "Authorization: Bearer $STARCO_CONSOLE" -H "Content-Type: application/json" \
-d '{"name": "quickstart", "scopes": ["read", "write"], "ttl_days": 7}')
echo "$RESP"
export STARCO_KEY=$(echo "$RESP" | jq -r .secret)r = requests.post(f"{API}/projects/{project['id']}/keys", headers=C,
json={"name": "quickstart", "scopes": ["read", "write"], "ttl_days": 7})
print(r.json())
key = r.json()["secret"]const created = await c.projects.keys.create(project.id, { name: "quickstart", scopes: ["read", "write"], ttlDays: 7 });
console.log(created.key.prefix, created.key.scopes, created.key.expires_at);
c.apiKey = created.secret; // shown once: in your own code read it from the environmentstarco keys create --name quickstart --scope read --scope write --ttl 7d --save # --save keeps the secret (0600){ "key": { "id": "51c0e7d2-…", "name": "quickstart", "prefix": "starco_dk_51c0e7d2",
"scopes": ["read", "write"], "state": "active", "expires_at": "2026-11-26T15:40:02Z",
"revoked_at": null, "last_used_at": null, "created_at": "2026-11-19T15:40:02Z" },
"secret": "starco_dk_51c0e7d2_…",
"note": "The secret is shown only now and cannot be recovered. Send it as \"Authorization: Bearer <secret>\"." }The secret is shown once and STARCO keeps only a keyed hash of it: the curl lines keep it in STARCO_KEY, the Python lines in key, the TypeScript lines in the client and the command line in its own configuration, for the next steps. Keep it in your environment or a secret store, never in code you commit.
STEP 4 Create a twin Beta#
TWIN=$(curl -s -X POST "$API/twins" \
-H "Authorization: Bearer $STARCO_KEY" -H "Content-Type: application/json" \
-d '{"template": "daily_movement", "layers": ["wellness"], "label": "quickstart"}' | jq -r .twin.id)
echo "$TWIN"H = {"Authorization": f"Bearer {key}"}
twin = requests.post(f"{API}/twins", headers=H, json={
"template": "daily_movement", "layers": ["wellness"], "label": "quickstart"}).json()["twin"]
print(twin["id"])const twin = await c.twins.create({ template: "daily_movement", layers: ["wellness"], label: "quickstart" });
console.log(twin.id);starco twins create --template daily_movement --layers wellness --label quickstart{ "twin": { "id": "3a9d5e2c-8b14-4f7a-a6d1-c2e09f4b7d31", "template": "daily_movement",
"layers": ["wellness"], "custom_layers": [], "label": "quickstart", "origin": "api", "data_class": "synthetic",
"created_at": "2026-11-19T15:41:58Z", "updated_at": "2026-11-19T15:41:58Z" } }STEP 5 Send an observation Beta#
An observation is one value of one kind, in the kind's exact unit, at the time it refers to (observed_at, RFC 3339 with an offset).
curl -s -X POST "$API/twins/$TWIN/observations" \
-H "Authorization: Bearer $STARCO_KEY" -H "Content-Type: application/json" \
-d '{"observations": [{"kind": "steps", "value": 8432, "unit": "steps", "observed_at": "2026-11-18T21:00:00Z"}]}'r = requests.post(f"{API}/twins/{twin['id']}/observations", headers=H, json={"observations": [
{"kind": "steps", "value": 8432, "unit": "steps", "observed_at": "2026-11-18T21:00:00Z"}]})
print(r.status_code, r.json())const batch = await c.observations.send(twin.id, [
{ kind: "steps", value: 8432, unit: "steps", observed_at: "2026-11-18T21:00:00Z" }]);
console.log(batch.accepted, batch.rejected, batch.recomputed_layers);starco obs add <twin> steps 8432 steps --at 2026-11-18T21:00:00Z200 { "batch_id": "c1d2e3f4-…", "accepted": 1, "rejected": [], "recomputed_layers": ["wellness"] }The layer was recomputed before the answer. The answer is 200 when at least one line was accepted and 422 when none was.
STEP 6 Read the layer Beta#
curl -s "$API/twins/$TWIN/layers/wellness" -H "Authorization: Bearer $STARCO_KEY"layer = requests.get(f"{API}/twins/{twin['id']}/layers/wellness", headers=H).json()
for k in layer["kinds"]:
print(k["kind"], k["count"], k["mean"])const layer = await c.twins.layer(twin.id, "wellness");
for (const k of layer.kinds) console.log(k.kind, k.count, k.mean);starco layer <twin> wellness{ "twin_id": "3a9d5e2c-8b14-4f7a-a6d1-c2e09f4b7d31", "layer": "wellness", "template": "daily_movement",
"computed_at": "2026-11-19T15:42:31Z", "observation_count": 1,
"description": "Descriptive values of the observations received: no reference range, no interpretation, no score. Null means no data.",
"kinds": [
{ "kind": "steps", "unit": "steps", "count": 1,
"latest": { "value": 8432, "observed_at": "2026-11-18T21:00:00Z" },
"min": 8432, "max": 8432, "mean": 8432, "mean_last_7_days": 8432,
"first_observed_at": "2026-11-18T21:00:00Z", "last_observed_at": "2026-11-18T21:00:00Z" },
{ "kind": "sleep_hours", "unit": "h", "count": 0, "latest": null,
"min": null, "max": null, "mean": null, "mean_last_7_days": null,
"first_observed_at": null, "last_observed_at": null },
… ] }Notice sleep_hours: no observations, so its values are null, not zero.
STEP 7 See yourself in the audit chain Beta#
curl -s "$API/audit?after_seq=2" -H "Authorization: Bearer $STARCO_KEY"for e in requests.get(f"{API}/audit", headers=H, params={"after_seq": 2}).json()["data"]:
print(e["seq"], e["actor_type"], e["actor_ref"], e["action"], e["http_status"])for (const e of (await c.audit.list({ afterSeq: 2 })).data) console.log(e.seq, e.actor_type, e.actor_ref, e.action, e.http_status);
console.log(await c.audit.verifyLocal()); // recomputes every hash of the chain here, with no secretstarco audit list --after-seq 2
starco audit verify3 console e4a1c7d0-… key.created 201
4 key starco_dk_51c0e7d2 twins.store 201
5 key starco_dk_51c0e7d2 observations.store 200
6 key starco_dk_51c0e7d2 layers.show 200Console actions name the account id, key requests the key's prefix; never a secret.
What just happened
You created a project, a key and a twin; one observation triggered a recompute of the wellness layer; you read it; and each of those actions became a row of the project's audit chain, including the read. The row of the request that lists the chain is appended after its answer, so you will see it next time.