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.

SDKs Coming Soon

Alpha

We have SDKs ready to go and they'll be released as alpha versions for our first customers.

We encourage users to play around with our REST API, which is autogenerated from our codebase. API docs are a first-class concern in our development cycle.

The examples below show the future SDK interface for reference.

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

Coming Soon

Once SDKs are released as alpha versions, you'll install them with:

npm install @bearbilling/node-sdk@alpha

For now, use the REST API directly. Examples below show the planned SDK interface for reference.

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: 'customer@example.com',
  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