OneOS Docs
Genesis 0.3.3 Console

Get started

Quickstart: SDK

The TypeScript SDK is one typed client for every Genesis service. Install it, pass your key, and call any operation by its id.

1. Install

npm install https://os.one.ml/pkg/onesi-genesis-0.3.3.tgz

Genesis 0.3.3 installs from https://os.one.ml/pkg/: the release archives, byte for byte what npm will carry (sha256 in ARTIFACT-MANIFEST.json: onesi-genesis-0.3.3.tgz 5ce698b66b1a59809df6a42ac33d6af0db734d8a84524aaafa78af2f813eee5f, onesi-genesis-cli-0.3.3.tgz 9a13609db60f0d09005818b2186ee8dea0fe8814bdb2b53dae8c025132af8c51, onesi-genesis-mcp-0.3.3.tgz 48bf40d159e4df1b8f930f1319a9233b1e3d679dbb26eee31e9fcde7dc389bb0). Install the packages in one command as shown, so the CLI and the MCP server find the SDK. The newest version on npm is older; npm install @onesi/genesis gives you that one.

The SDK is ESM only and runs on Node.js 20.19 or later; tested on 20, 22 and 24.

2. Create a client

export GENESIS_API_KEY="sk_..."
import { Genesis } from '@onesi/genesis'

// Reads GENESIS_API_KEY (or your `genesis login`) when apiKey is omitted.
const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })

The client talks to https://os.one.ml/api. Set baseUrl or GENESIS_BASE_URL to point it elsewhere; only https:// (or http:// on loopback) is accepted.

3. Create a project, store a secret, clean up

genesis.call(operationId, input) reaches every operation in the API reference. Path and query parameters go in by name; the request body goes under body.

quickstart.mjs
import { Genesis, GenesisError } from '@onesi/genesis'

const genesis = new Genesis({ apiKey: process.env.GENESIS_API_KEY })

const project = await genesis.call('hives_create_project', {
  body: { name: 'quickstart', kind: 'function' },
})
console.log('created', project.id)

try {
  await genesis.call('hives_create_secret', {
    project_id: project.id,
    body: { name: 'DATABASE_URL', value: 'postgres://example' },
  })
  const secrets = await genesis.call('hives_list_secrets', { project_id: project.id })
  console.log(secrets.data.map((s) => `${s.name} v${s.version}`))
} catch (e) {
  if (e instanceof GenesisError) console.error(e.status, e.code, e.requestId, e.message)
  throw e
} finally {
  await genesis.call('hives_delete_project', { project_id: project.id })
}
node quickstart.mjs

4. Handle errors

Every failure is a GenesisError with status, code, requestId and a message from the gateway's error catalog. errorCatalog(e) adds required_scope and docs_url.

import { GenesisError, errorCatalog } from '@onesi/genesis'

try {
  await genesis.call('hives_delete_project', { project_id: 'prj_missing' })
} catch (e) {
  if (!(e instanceof GenesisError)) throw e
  const { code, required_scope, docs_url } = errorCatalog(e)
  console.error(e.status, code, required_scope, docs_url, e.requestId)
}

Next

  • Service helpers such as genesis.hives.projects.list(), idempotency keys and every option: SDK reference.
  • Find an operation id: each operation in the API reference shows it next to its endpoint.

L1fe AI Inc. · Built from Genesis 0.3.3 and the live gateway on 2026-10-25. Support