Skip to main content

Prerequisites

  • A Carbon account and a space in the dashboard
  • An application that calls the OpenAI, Anthropic, or Vercel AI SDK
1

Create an API key

In the dashboard, go to Settings → API Keys and click New.
The full key is shown once, right after creation. Copy it before closing the modal — afterwards only a key hint is visible.
Store the key in your application’s environment:
.env
2

Install the SDK

3

Wrap your AI client

Create a Carbon instance and wrap the SDK you already use. The wrapper preserves your existing call sites; events are captured automatically.
Carbon reads CARBON_API_KEY from the environment by default. You can pass apiKey explicitly instead — see Configuration.
On serverless platforms like Next.js, Vercel, or AWS Lambda, flush buffered events before the function exits — see Serverless.
4

View your events

Open Events in the dashboard. Your calls appear within seconds, with model, token usage, cost, duration, and status. From there, explore Cost and the per-dimension pages for agents, models, users, threads, and tools.

Next steps

Tag events with context

Add agent, user, thread, and custom dimensions so the dashboard can slice by them.

Correlate with traces

Group the events of one agent run, request, or job under a shared trace ID.

Capture tool calls

Wrap your own functions so tool executions show up next to LLM calls.