LangSmith is LangChain’s platform for debugging, testing, evaluating, and monitoring LLM applications.
In LangSmith, go to Settings > API Keys to create a new API key. Then navigate to your project or create a new one to get the project name.
Go to Settings > Observability and toggle Enable Broadcast.

Click the edit icon next to LangSmith and enter:
lsv2_pt_...)https://api.smith.langchain.com. Change for self-hosted instancesClick Test Connection to verify the setup. The configuration only saves if the test passes.
Make an API request through OpenRouter and view the trace in LangSmith. Your traces will appear in the specified project with full details including:
OpenRouter sends traces to LangSmith using the OpenTelemetry (OTEL) protocol with the following attributes:
LangSmith uses the OTEL endpoint at /otel/v1/traces for receiving trace data. This ensures compatibility with LangSmith’s native tracing infrastructure.
LangSmith supports trace hierarchies, tags, and custom metadata for organizing and analyzing your LLM calls.
Any array of strings passed in metadata can be used as tags. Tags in LangSmith are comma-separated values that help you filter and organize traces.
OpenRouter maps observation types to LangSmith run types:
llm run typechain run typetool run typeuser field maps to LangSmith’s User IDsession_id field maps to LangSmith’s Session ID for conversation trackingWhen Privacy Mode is enabled for this destination, prompt and completion content is excluded from traces. All other trace data — token usage, costs, timing, model information, and custom metadata — is still sent normally. See Privacy Mode for details.