Skip to Content

Client SDK

The Modem Client SDK connects your application to a Modem project. A CustomerClient acts for one customer. It holds the customer’s session, and the gateway meters its requests against that customer’s product. These guides use the Client SDK 9.2 API. Check your installed package version before copying an example. Version availability distinguishes the supported package baseline from current source additions.

Before you begin

You need:

  • Node.js 20 or later.
  • A Modem project ID.
  • A product connected to at least one provider account.
  • A usage limit on that product that covers the model you want to call.
  • A way to sign in the customer.

See Create a project, Configure a product, and Configure a provider account.

Install the SDK

Complete package access and registry setup first, then install the customer SDK:

bun add @preternatural-js/client-sdk

What the client provides

createCustomerClient() returns a CustomerClient with one property for each area:

To create the client, see Configure the Client SDK.

Choose an integration

Use the chat helpers for text chat, provider SDKs for native request shapes, or the speech client for ElevenLabs and Rime AI. Your own app server can relay customer requests and offer resumable streams. See the gateway API matrix before choosing a modality.