Developer Guide · Start here

Quickstart

Bear Lumen tracks the AI calls you already make. There are two ways to send us usage: our SDK or the REST API. Pick the one that fits your stack, then follow that guide. Not ready to install anything? The SDK Playground runs the whole loop from your browser.

Before you start

  • A Bear Lumen account (get started here)
  • An API key from your dashboard settings with the usage:write scope, plus costs:read if you want to read costs back
  • An AI provider you already call (OpenAI, Anthropic, Google, and more)

Choose your path

Calling AI from an agent? Trace the whole run

The SDK path does more than per-call tracking. Wrap your provider client once and every call is tracked automatically, then group a multi-call agent run into a span to get the full call tree, cost per outcome, and budget limits. See Tracing agentic work.

Then what? Reading your costs

Once you're tracking, the same numbers are available two ways, with no extra setup. Ingestion is asynchronous, so allow a short delay after your first events before the numbers appear. Query the summary endpoints (bear.costs.summary() or GET /v1/cost-data/summary) to wire an AI agent or MCP server straight to your spend, or skip the code and read the same breakdowns in your dashboard.

Need help?

Our team is here to help you get the most out of Bear Lumen. Email support →