Connect Node.js
The @recursiv/sdk is a zero-dependency TypeScript SDK that runs server side in Node.js. This is the most direct way to script Recursiv, run backend services, or build agent workers.
Requirements
- Node.js 18 or newer.
- An ESM project (
"type": "module"inpackage.json) for the import syntax below.
Install
Configure the key
No account yet? Sign up and mint a key at recursiv.io/account/api-keys.
The SDK reads RECURSIV_API_KEY automatically:
Or pass it explicitly with new Recursiv({ apiKey }).
First authenticated call
Most resources hang off a project. Create one, then run a query. Project IDs are UUIDs, so always use the id the API returns. Project-scoped calls return a { data } envelope.
Run and stream an agent
Create an agent against any model, then stream its replies. In Node, chatStream() returns an async iterable of { delta } chunks.
The model field is model agnostic. Pass any supported model id.
Run code in a sandbox
Node workers often need to execute generated code safely. The sandbox returns a { data, meta } envelope.
Where to go next
- Quickstart for the full set of first calls
- Add AI Agents to Node.js for agent details
- Add Authentication to Node.js for minting scoped keys
- API Reference for the full REST surface
- Recursiv ships hundreds of data integrations (Slack, email, databases, and more) that agents can call as tools