wrapOpenRouter and auto-instrumentation.
This guide covers manual instrumentation. For quicker setup, use auto-instrumentation.
Setup
Install the dependencies:.env
Trace with OpenRouter
Trace your OpenRouter calls for observability and monitoring.Trace automatically
Braintrust provides automatic tracing for OpenRouter calls. This is the recommended setup for most projects.Wrap an OpenRouter client
If you prefer explicit instrumentation, wrap the OpenRouter client withwrapOpenRouter.