@dailui/omega-api
v0.1.0
Published
Thin, typed JavaScript/TypeScript client for the Omega-API geometric judge.
Maintainers
Readme
@dailui/omega-api · JavaScript / TypeScript client
A thin, typed client for the Omega-API geometric judge. It sends one turn to the judge over HTTP, reads the gate, and returns a decision your app can act on.
This is not a wrapper. It is a comfort layer over one HTTP call. Every future SDK is a thin client over the same judge.
Zero runtime dependencies (native fetch). Node 18+. TypeScript types included. Apache-2.0.
What it does
Omega-API measures whether the process in an agent conversation is moving — turn by turn — and returns a decision.
There is no client-side session state to manage: the judge keeps it server-side, per sessionId. The interface is
open; the judging method is proprietary.
Before you start: register → key → judge → meter
- Register and create a project at your Omega-API account page.
- Get an API key (
oapi_live_…). - Judge: one call per turn.
- Meter: your first 100 judgments are free; after that, billing applies.
Set your key in the environment:
export OMEGA_API_KEY=oapi_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInstall
npm install @dailui/omega-apiQuick start
import { Omega } from "@dailui/omega-api";
const omega = new Omega(); // reads OMEGA_API_KEY
const decision = await omega.judge({
input: "customer message",
output: "agent reply",
});
if (decision.release) {
show(reply); // PROCEED or Shadow mode
} else if (decision.isClarify) {
await regenerateThenCallAgain();
} else if (decision.isSuppress) {
stopOrEscalate();
}turnId is omitted by default, so the judge assigns a unique one and returns it (decision.turnId). When sessionId
is omitted, the client mints a fresh one for the call.
Act on the gate
Read the gate and act before you display the agent's response:
| gate action | what your app does |
| ----------- | --------------------------------------------------------------------------- |
| release | show the original response |
| clarify | do not release yet — ask the agent to realign / regenerate, then call again |
| suppress | do not release — stop / escalate / fall back per your policy |
| none | Shadow mode — observe only, show the original |
In Shadow mode the gate always returns none. Operator mode is opt-in per key. The getters decision.release,
decision.isClarify, and decision.isSuppress read the gate directly.
Real multi-turn conversations
Keep one sessionId per conversation:
const session = omega.session("support-ticket-123");
const d1 = await session.judge({ input: "hi", output: "hello" });
const d2 = await session.judge({ input: "my order never arrived", output: "let me check that for you" });Fail-open is a policy, not a default
judge() rejects on every error — auth, bad request, 409 TURN_CONFLICT, rate limit, server, transport. If you want
to release the original when the judge is unreachable, opt in explicitly:
const decision = await omega.judgeOrRelease({ input: msg, output: reply });
// on a transport/server failure: decision.release === true, decision.judged === falseOnly transport and server errors are treated as fail-open. Auth, request-shape, conflict, and rate-limit still reject.
What Omega-API does not claim
It measures whether the process moved. It does not promise the agent achieved the user's goal — the two are independent. Act and bill on the movement; read the outcome separately.
Errors
OmegaConfigError · OmegaAuthError · OmegaRequestError · OmegaConflict · OmegaRateLimited ·
OmegaServerError · OmegaTransportError — all subclasses of OmegaError.
On the roadmap
observedEvent() — anchoring a real business outcome to a session — is planned for a future release, in parity with the
Python SDK. It requires a key with the events capability. Most first integrations never send events; that is a
legitimate state, not an error.
Links
- Learn more: https://omega.dailui.com/integrations.php
- Examples & HTTP runner: https://github.com/DaiLui/omega-api-examples
- Python client:
pip install omega-api
License
Apache-2.0.
