Deuz SDK
One TypeScript SDK. Models, agents, and swarms.
Deuz is a TypeScript library that calls models from Anthropic, OpenAI, Google and other providers, and runs agents and swarms in your own process. It is for applications that must limit what a run spends and account for what it did: budgets shared across processes, receipts for tool calls, signed approvals, and runs that resume after a crash.
Documentation (deuz-sdk.tech/docs) · Examples · What's new in 2.5 · Changelog
Start building
npm install @deuz-sdk/core
Set ANTHROPIC_API_KEY, then run your first agent:
import { runAgent } from '@deuz-sdk/core/agent';
import { createAnthropic } from '@deuz-sdk/core/anthropic';
const anthropic = createAnthropic({ apiKey: process.env.ANTHROPIC_API_KEY! });
const result = await runAgent({
model: anthropic('claude-opus-5-5'),
prompt: 'Explain how rainbows form in three sentences.',
maxSteps: 4,
});
if (result.status === 'completed') console.log(result.output);
else console.error(result.status, result.status === 'failed' ? result.error.message : '');
Save it as agent.mts and run node agent.mts. Node.js runs a .mts file directly from 22.18 (on the 23 line, from 23.6); core itself supports Node.js 22 and newer. createAnthropic does not read the environment, so you pass the key in. Without a key the run returns failed, and the last line prints why.
The examples run from a clone of this repository. 01–06 call Anthropic with your key. The rest need no key and no network, with two exceptions: 13-headless calls Anthropic when ANTHROPIC_API_KEY is set, and 23-docker-runner needs a local Docker engine.
Packages
| Package | What it is | Status |
|---|---|---|
@deuz-sdk/core |
The SDK: models, agents, swarms and every module under "What ships" | Stable, except labelled previews |
@deuz-sdk/react |
useChat, useObject and headless chat components for React 18 and 19 |
Stable |
@deuz-sdk/ai-sdk-provider |
A Deuz budget, fail-over and a circuit breaker for Vercel AI SDK 7 models | Stable |
@deuz-sdk/mcp-ledger |
A ready-made MCP server: versioned memory, an advisory spend record and a hash-chained receipt log | Stable |
@deuz-sdk/cli |
The deuz command: deuz meter, a budget proxy for coding agents, and deuz acp, which serves an agent to an editor |
Preview |
All five are published together at one version, as ESM and CommonJS builds with type declarations; the last three are new in 2.5. Core, the React bindings and the AI SDK provider have no runtime dependencies, and the libraries core's integrations use are optional peer dependencies. Core's SQLite stores (unless you pass them your own database handle), the MCP ledger and the CLI's --store option need Node.js 22.13 or newer.
Core's edge-safe import paths use only Web APIs. CI checks that by bundling representative imports for the browser platform; no test runs on Bun, Deno or Cloudflare Workers. Integrations that need Node.js have their own import paths.
What ships
- Models, one API across providers: streaming, structured output, tool calls, embeddings, realtime voice and batch requests.
- Agents, typed results, verification, approvals, memory, model fail-over and resumable runs. In a native run each tool call gets a receipt, so a resume reuses a recorded result instead of running the tool again.
- Swarms, agent tasks with dependencies, runtime spawning, shared blackboards and rounds, persisted in SQLite, Postgres or Redis.
- Budgets, persistent token and USD budgets per user, thread or organisation, shared by every process on the same store. A call whose estimate does not fit is refused before it is sent.
- Signed approvals, an approval signer puts an HMAC token on each approval request. The token proves which call was approved, not who approved it.
- Operations, runs across several processes: leases, drain, crash recovery and cancel from any process. Also schedules and webhooks, a goal supervisor, a local Docker runner (preview) and headless runs (preview).
- Context, versioned memory, a context compiler (partly preview) with working memory, retrieval, compaction and transcript search.
- Chat UI, a versioned, resumable stream protocol, chat persistence and React hooks.
- Interop, an MCP client and MCP server, and A2A (Agent2Agent) to call other agents and serve your own.
- Evolve, evolutionary program search with a mandatory budget. A resume replays the stored candidates without calling a model, then continues.
- Observability, local events for every run, an OpenTelemetry bridge and eval suites.
A ceiling limits what Deuz admits, not what a provider invoices: admission works on estimates, so each call admitted near the ceiling can overshoot it. A USD budget set in code needs a price provider (createPriceProvider from @deuz-sdk/core/pricing); without one the calls run and their dollars are not counted. The meter, the AI SDK provider and the deuz CLI add one by default.
Receipts do not make a tool's side effect exactly-once. If a crash interrupts a tool call, Deuz cannot know whether it ran, so the resume stops at that call until you retry it or record its outcome; a tool marked idempotent does not stop the resume. Without a lease provider, let only one process drive a given swarm or agent run.
New in 2.5
2.5 applies Deuz's budgets, receipts and signed approvals outside your own code: to coding agents such as Claude Code and Codex, to ACP editors, to Vercel AI SDK code and to MCP clients.
Meter, a local proxy that charges the model requests of Claude Code, Codex or any Anthropic or OpenAI client to a budget, and refuses them with 402 at the ceiling. It is a core module you can mount in code; the
deuzCLI (preview) is the short way to start it:npx @deuz-sdk/cli meter --budget-usd 5 -- claudeThe budget stays in memory for that run unless you pass
--store <file>.Harness runner (preview),
runHarnessruns Claude Code, Codex, OpenCode or Gemini CLI as a sub-agent, applies your policy to the permission requests the harness sends, and reports the cost the meter measured next to the cost the harness declared. The first three run under a budget; Gemini CLI cannot be metered, so it has a declared cost only and no ceiling.ACP (Agent Client Protocol, preview), serves a Deuz agent to ACP editors such as Zed and JetBrains IDEs, with signed approvals and a budget, and drives any ACP agent from code. It has not run in a real editor yet.
Tool search, puts a large tool catalog behind one lexical search tool. A search never returns a tool the run's policy refuses, and it leaves out or labels a tool whose cost estimate does not fit the remaining budget.
AI SDK provider, wraps a Vercel AI SDK 7 model in one line, so existing AI SDK code runs under a Deuz budget.
MCP server, now publishes resources and prompts next to tools, can change its catalog at runtime, and can run opted-in tools as MCP tasks (preview).
MCP ledger,
npx -y @deuz-sdk/mcp-ledgerstarts it for any MCP client. Its spend record is advisory: nothing is refused.
Stability. The items marked preview can still change in 2.6; everything else in this list is stable.
What ran against real tools. On 2026-11-24 the meter (deuz meter in front of claude -p) and the harness runner's Claude Code preset ran against real Claude Code. Codex on a ChatGPT login reached the meter only through a custom model provider, and the change that measures its traffic has a unit test only. ACP passed a conformance run against the official ACP TypeScript SDK. Nothing else in 2.5 met a real model, editor or MCP host; the support matrix has the detail.
Upgrading. 2.4 code that calls the API compiles unchanged, and nothing new runs until you import it. Three things changed for code that serves tools over MCP: a server with no tools now answers tools/list with [] instead of an error, served tool call ids have a new format, and a class that implements DeuzMcpServer itself needs the new catalog member. The upgrade notes cover all three and each new module's limits. Known gaps says where other SDKs do more than Deuz, and what to use there instead.
Earlier releases: 2.4 added versioned memory, the context compiler, a goal supervisor and a local Docker runner; 2.3 added an MCP server, A2A, realtime voice, batch requests and Redis backends.
Add the coding-agent skills
npx skills add Deuz-AI/Deuz-SDK
The command offers two skills, instruction files that a coding agent such as Claude Code loads when a task needs them: deuz-sdk (API references and implementation guidance) and migrate-from-ai-sdk (the mapping for porting an app from the Vercel AI SDK).
MIT · Built by Umutcan Edizaslan
Built with Opus 4.8 / 5 / 5.5, Fable 5 / 5.1 / 5.2, and GPT-6 Astra Ultra.