Back to Guides

Quick Start Guide

10 min

Get up and running with Bear Billing in 10 minutes. This guide will walk you through creating your first customer, subscription, and tracking AI usage.

Node.js SDK Now Available

Alpha

Our Node.js SDK is now available as an alpha release. Install it with npm install @bearbilling/node-sdk@alpha

Python SDK coming soon. In the meantime, you can also use our REST API directly from any language.

Alpha releases are for early testing. Your feedback helps shape the stable release.

Prerequisites

  • A Bear Billing account (sign up here)
  • An API key from your (dashboard settings)
  • Node.js 18+ or Python 3.9+ installed (or use REST API from any language)

Installation & Setup

1

SDK Installation

Install the Bear Billing Node.js SDK:

npm install @bearbilling/node-sdk@alpha
2

Initialize the Client

Set up your API client with your API key:

import { BearBilling } from '@bearbilling/node-sdk';

const bearBilling = new BearBilling({
  apiKey: process.env.BEAR_BILLING_API_KEY,
});
3

Create a Customer

First, create a customer record in Bear Billing:

const customer = await bearBilling.customers.create({
  email: '[email protected]',
  name: 'Acme Corporation',
  metadata: {
    userId: 'user_123',
    plan: 'pro'
  }
});

console.log('Customer created:', customer.id);
4

Create a Subscription

Now create a subscription for your customer:

const subscription = await bearBilling.subscriptions.create({
  organizationId: customer.id,
  planId: 'plan_pro_monthly',
  billingCycle: 'monthly',
  startDate: new Date().toISOString()
});

console.log('Subscription created:', subscription.id);
console.log('Status:', subscription.status);
5

Track Usage

Optional

If you're using usage-based billing, record usage events:

await bearBilling.usage.record({
  subscriptionId: subscription.id,
  metricName: 'api_calls',
  quantity: 100,
  timestamp: new Date().toISOString()
});

You're all set!

You've successfully integrated the basics of Bear Billing. Now let's explore what you can do next.

Next Steps

Need Help?

Our team is here to help you get the most out of Bear Billing.

Email Support