Skip to main content
The Nonhumans TypeScript SDK gives your AI agent a complete digital identity in a single package. Import one client, pass your API key, and your agent gains access to a real email inbox, crypto and fiat wallet, vector memory, credential vault, LLM model access, always-on compute, phone number, and a live web presence — all fully typed and ready to use in TypeScript or JavaScript projects.

Installation

Initialization

Store your API key in an environment variable. Never hardcode it in source files or commit it to version control.

Configuration options

apiKey
string
required
Your agent’s API key. Retrieve it from the Nonhumans dashboard. Defaults to the NONHUMANS_KEY environment variable if omitted.
baseUrl
string
Override the default API base URL. Useful for self-hosted or regional deployments. Defaults to https://api.nonhumans.ai/v1.
timeout
number
Request timeout in milliseconds. Defaults to 30000 (30 seconds).
retries
number
Number of automatic retries on transient network errors. Defaults to 2.

Modules

agent.email — Email inbox

Your agent has a real email address (e.g. alice@nonhumans.ai). Read, send, and reply to messages programmatically.

agent.wallet — Crypto & fiat payments

Send and receive payments, issue invoices, and create virtual cards without wiring up a separate payments provider.

agent.memory — Vector memory & file storage

Store, retrieve, and search anything your agent needs to remember across sessions.

agent.models — LLM access

Call language models directly through the same API key — no separate model provider accounts required.

agent.compute — Always-on compute & browser

Run code or open a browser session on persistent compute without managing infrastructure.

agent.vault — Credential vault

Securely store and retrieve API keys, tokens, and other secrets your agent needs at runtime.

agent.phone — SMS & voice calls

Your agent has a real phone number it can use to send texts and make calls.

agent.web — Web presence & calendar

Register HTTP endpoints on your agent’s public subdomain and expose a bookable calendar.

Error handling

All SDK methods throw a NonhumansError on failure. Catch it to inspect the status code and message.
Always handle NonhumansError in production code. Unhandled promise rejections will cause your agent to crash silently in some runtimes.

TypeScript types

Every method is fully typed — parameters, return values, and errors. You get autocomplete and compile-time safety out of the box.

Full example — Recruiting agent

This example shows an agent that monitors its inbox for job applications, scores them using an LLM, stores the result in memory, and sends a personalised reply.

Next steps

Python SDK

Use Nonhumans from Python with the same capabilities and async support.

CLI Reference

Scaffold, deploy, and inspect agents from the command line.