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.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.
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.