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 @lifesi/genesis@0.1.12The 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 '@lifesi/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.
import { Genesis, GenesisError } from '@lifesi/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.mjs4. 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 '@lifesi/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.
One Superintelligence, Inc. · Built from Genesis 0.1.12 and the live gateway on 2026-10-20. Support