Skip to main content

Track what your AI featuresactually cost

One SDK call per AI request. Auto-detects provider, extracts tokens, calculates cost. Works from day one — no customers, billing, or revenue required.

One line to track costs

Before
const response = await openai.chat
  .completions.create({
    model: 'gpt-4o',
    messages: [{ role: 'user', content: prompt }],
  });

// You know the response.
// You don't know the cost.
After
const response = await openai.chat
  .completions.create({
    model: 'gpt-4o',
    messages: [{ role: 'user', content: prompt }],
  });

bear.track(response, {
  feature: 'dungeon-master',
  userId: session.userId,
});

bear.track() is fire-and-forget. It detects the provider, extracts token counts, and queues the cost event. Your request latency is unchanged.

Auto-detects your AI providers

OpenAI

GPT-4o, GPT-4o-mini, o1, o3

Anthropic

Claude Opus, Sonnet, Haiku

AWS Bedrock

Any model via Bedrock

Google Gemini

Gemini Pro, Flash, Ultra

Mistral

Large, Medium, Small

Ollama

Any local model

Built for production

Fire-and-forget

bear.track() returns instantly. Cost calculation happens asynchronously.

Auto-detection

Pass any provider response. The SDK identifies the provider and extracts tokens automatically.

Streaming support

Wrap streams with bear.wrapStream(). Costs are calculated when the stream completes.

Non-blocking

Events are batched and flushed in the background. Zero impact on request latency.

Custom dimensions

Attach feature, userId, tier, or any custom metadata. Slice costs however you need.

Works pre-revenue

No customers, billing, or revenue required. Start tracking costs from your first AI call.

Start with cost tracking. The rest follows.

When you're ready for margins, pricing validation, or investor metrics — the same data pipeline powers it all.