LangSmith

Export TheRouter.ai spans into LangSmith runs for debugging and evaluation

LangSmith integration makes TheRouter.ai requests visible in LangChain-native observability tooling with run hierarchy, metadata tags, and performance insights.

broadcast-langsmith-config.json
{
  "destination": "langsmith",
  "enabled": true,
  "api_key": "lsv2_pt_...",
  "project": "therouter-prod",
  "endpoint": "https://api.smith.langchain.com",
  "sampling_rate": 1
}
cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Authorization: Bearer $THEROUTER_API_KEY"   -H "Content-Type: application/json"   -H "X-TheRouter.ai-Broadcast: true"   -d '{
    "model":"anthropic/claude-sonnet-4.5",
    "messages":[{"role":"user","content":"Draft an escalation response"}],
    "trace":{"trace_name":"LangSmith E2E","team":"support-ops"}
  }'
Verification
Open your configured LangSmith project and confirm a new run appears with model, token, cost, and request metadata fields.