Skip to content
AGENT SDK · OPEN SOURCE

Neox Agent SDK

The same agent runtime the Neox client uses, open source under Apache-2.0. Embed it in your product and bring your own models.

Apache-2.0TypeScriptNode 20+BYOK
Build from source
$git clone https://github.com/neoxlabs/OpenNeox
01GET STARTED

Three steps

The npm package is not published yet. Each path below was verified on a fresh clone.

1Run it in the repo

Install, build the packages, and run a bundled example. 06-mock needs no API key.

git clone https://github.com/neoxlabs/OpenNeox
cd OpenNeox
npm ci && npm run build:packages
npx tsx packages/sdk/examples/06-mock.ts
2Add it to your project

Pack a tarball from the SDK folder (the kernel is inlined, about 0.9 MB) and install it as a local file.

cd packages/sdk && npm pack
# in your project
npm install /path/to/neoxlabs-sdk-2.7.0.tgz zod
3Connect a model

Bring a provider key and requests go direct, or use one Neox Platform key for several providers, billed per use.

export ANTHROPIC_API_KEY=sk-...   # your own key
# or Neox Platform
export NEOX_API_KEY=sk-neox-...
02EXAMPLES

Code samples

Minimal run, a tool, streaming, built-ins, Neox Platform, offline mock, bring your own key.

typescript
import { Agent } from '@neoxlabs/sdk';

const agent = new Agent({ model: 'claude-sonnet-4-6' });

const res = await agent.run('Explain the CAP theorem in one sentence');

console.log(res.text);
console.log(res.usage);        // { inputTokens, outputTokens, ... }
console.log(res.stopReason);   // 'end_turn' | 'max_steps' | 'tool_error' | ...
03WHAT YOU GET

SDK capabilities

Run loop
Call tools, observe results and iterate to completion, with a step cap (50 by default).
Zod tools
Schemas define input; handler types are inferred, validated at runtime, 60s timeout by default.
Streaming events
Text, thinking, tool calls, approval requests and step boundaries. Ten event types.
Multi-provider
Anthropic, OpenAI, DeepSeek, Gemini, Kimi, GLM, Doubao and any OpenAI-compatible endpoint.
Built-in tools
File access pinned to a root; commands run from an allow-list without shell interpolation.
Sessions
Multi-turn context you can fork, persist and resume across processes.
04PRIMITIVES

Six primitives. The full API surface.

AgentThe executor: model, tools, permission, caps
tool()A Zod schema plus a handler
provider()Model config: type, key, baseURL
AgentEventStreaming event union with ten types
SessionMulti-turn context: fork, persist, resume
mockLlm()A scripted offline model for tests and CI
05SOURCE

Source

The SDK lives in the OpenNeox repository and shares its runtime with the Neox client. Accounts, subscriptions and the model gateway are not part of the open-source release.

The source is on GitHub

Apache-2.0. Issues and pull requests are welcome.