Neumera

Starter apps

These starter apps are the fastest way to move from a first key to a working integration.

They use the same public sandbox flow documented in Quickstart: request a key, create a session, step the session, inspect runtime and world state.

TypeScript starter

Single-file Node.js script for the canonical hosted API sandbox sequence.

const API_BASE = "https://api.neumera.io";

async function main() {
  const access = await fetch(`${API_BASE}/v1/access/request`, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      name: "TypeScript Starter",
      email: "builder@example.com",
      intended_use: "First Neumera integration",
    }),
  });
  const accessData = await access.json();
  const apiKey = accessData.api_key;

  const createSession = await fetch(`${API_BASE}/v1/sessions`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": apiKey,
    },
    body: JSON.stringify({ continuity_mode: "preserve" }),
  });
  const sessionData = await createSession.json();
  const sessionId = sessionData.payload.session_id;

  const step = await fetch(`${API_BASE}/v1/sessions/${sessionId}/step`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "X-API-Key": apiKey,
    },
    body: JSON.stringify({
      input_packet: {
        command: "summarize_state",
        args: { focus: "first-build" },
      },
    }),
  });
  const stepData = await step.json();

  const runtime = await fetch(`${API_BASE}/v1/runtime/summary?session_id=${sessionId}`, {
    headers: { "X-API-Key": apiKey },
  });
  const runtimeData = await runtime.json();

  const world = await fetch(`${API_BASE}/v1/worlds/state`, {
    headers: { "X-API-Key": apiKey },
  });
  const worldData = await world.json();

  console.log({ apiKey, sessionId, stepData, runtimeData, worldData });
}

main().catch((error) => {
  console.error(error);
  process.exit(1);
});

Python starter

Single-file Python script for the same hosted sandbox flow.

import requests

API_BASE = "https://api.neumera.io"


def main() -> None:
    access = requests.post(
        f"{API_BASE}/v1/access/request",
        json={
            "name": "Python Starter",
            "email": "builder@example.com",
            "intended_use": "First Neumera integration",
        },
        timeout=30,
    )
    access.raise_for_status()
    api_key = access.json()["api_key"]

    headers = {"X-API-Key": api_key}

    session = requests.post(
        f"{API_BASE}/v1/sessions",
        headers={**headers, "Content-Type": "application/json"},
        json={"continuity_mode": "preserve"},
        timeout=30,
    )
    session.raise_for_status()
    session_id = session.json()["payload"]["session_id"]

    step = requests.post(
        f"{API_BASE}/v1/sessions/{session_id}/step",
        headers={**headers, "Content-Type": "application/json"},
        json={
            "input_packet": {
                "command": "summarize_state",
                "args": {"focus": "first-build"},
            }
        },
        timeout=30,
    )
    step.raise_for_status()

    runtime = requests.get(
        f"{API_BASE}/v1/runtime/summary",
        headers=headers,
        params={"session_id": session_id},
        timeout=30,
    )
    runtime.raise_for_status()

    world = requests.get(
        f"{API_BASE}/v1/worlds/state",
        headers=headers,
        timeout=30,
    )
    world.raise_for_status()

    print(
        {
            "api_key": api_key,
            "session_id": session_id,
            "step": step.json(),
            "runtime": runtime.json(),
            "world": world.json(),
        }
    )


if __name__ == "__main__":
    main()