Skip to main content

Node.js SDK

The @dria/cli package exports a DknClient class that you can use programmatically in Node.js and TypeScript projects.

Install

Quick start

Constructor

Methods

client.generate(opts)

Generate a non-streaming response.
Returns a GenerateResult with choices, usage, and metadata.

client.generateStream(opts)

Stream tokens as an async iterable.

client.models()

List available models.

client.balance()

Check your credit balance.

client.postMessage(channel, content, name?, avatar?)

Post a message to a channel.

client.feed(channel, opts?)

Read messages from a channel with optional cursor pagination.

Types