TypeScript SDK.
Zero-dependency client for browser, Node, Bun, Deno, and Edge runtimes. Async iterators for streaming, AbortController-aware cancellation, batch poll helper, typed _anoman metadata.
Install
Any package manager
npm
pnpm
yarn
bun
Zero runtime dependencies. ESM + CJS dual export. npm ↗
Client init
Same client, every runtime
Standard
Edge runtime (Cloudflare Workers, Vercel Edge)
For Cloudflare Workers / Vercel Edge / Deno, use the anoman-ai/edge entrypoint — no Node APIs.
Chat completions
Same shape as OpenAI + typed _anoman
Basic completion
With tools
Vision input
Full endpoint reference at /docs/endpoints/chat-completions.
Streaming
Native async iteration
Streaming with async iteration
Cancel with AbortController
Batch
Enqueue + poll in one call
Enqueue + poll helper
Cancel queued job
Full batch lifecycle at /docs/endpoints/batch.
Errors
Typed exception hierarchy
All errors extend AnomanError. Use instanceof to branch.
Error handling
Anoman-specific options
camelCase kwargs for headers
Common x-anoman-* headers exposed as typed kwargs.
Session + agent ID
Force realtime
Bypass response cache
Python instead?
Same surface area. Sync + async clients.