ReferenceBeta
SDK reference
The smallest successful omnious-sdk integration, with advanced surfaces linked only when you need them.
omnious-sdk has one core path: construct a client and call ask. The Interactive API Console runs a real request first, then generates SDK code from your exact prompt and settings.
playground firstIf you are integrating for the first time, use the console instead of reading this page top to bottom. Return here only when you need an advanced lifecycle such as tools, sessions, or direct x402.
not yet on npmThe package is not published to the npm registry yet, so
npm install omnious-sdk currently fails with a 404. Until it ships, build the tarball from the repository — it is self-contained (the router client modules are bundled in) and the import name below works unchanged once the package is published. The publish gate verifies the runtime bundle, declaration import closure, and exact harness/tool-policy version parity before a tarball can be released.# omnious-sdk is not on npm yet — build and install it from the repository
git clone https://github.com/LJ-XRPL/Ai-economics
cd Ai-economics/sdk && bun install && bun run build
npm pack # emits omnious-sdk-0.1.0.tgz — install that tarball in your appimport { OmniousClient } from "omnious-sdk";
const omnious = new OmniousClient({
routerUrl: "https://api.omnious.xyz",
creditKey: process.env.OMNIOUS_CREDIT_KEY,
});
const result = await omnious.ask("Explain model auctions simply.", {
model: "auto",
onDelta: (text) => process.stdout.write(text),
});Choose only the layer you need
| Need | SDK surface | Read next |
|---|---|---|
| One prompt or stream | ask, stream | Inference |
| Local tool execution | ask with tools and executors | Agent sessions |
| Local desktop execution | CuaDriverAdapter plus computer | Computer use |
| One funded multi-turn loop | session | Operations |
| Crash-safe long-running work | runTask, task, follow | Durable tasks |
| Market and receipt reads | models, receipt, analytics methods | Market data |
| No unified API balance | walletKey or signer | Direct x402 |
Defaults that remove boilerplate
model: "auto"lets the live market choose.creditKeymakes each ask one HTTP request.onDeltais the only callback needed for streaming.- Tool rounds, retries, payment envelopes, and stream parsing stay inside the SDK.
not in the mainnet launchEmbeddings, Context Passports, and speculative auctions are feature-gated for V1 mainnet. Image generation is live and its detailed contract lives in Wire formats, away from the core SDK learning path.
errorsEverything non-2xx throws
OmniousError. The common codes are spend_cap, feature_gated, and provider_failed; none should trigger a second payment.The full method inventory remains in sdk/README.md for generated clients and maintainers. The docs path stays focused on the smallest successful integration.
where this lives in code
- sdk/README.md complete method inventory
- sdk/src/index.ts client implementation and exported types
- router/src/agent/tools/registry.ts shared tool registry