wrap_openai / wrapOpenAI.
Use wrap_openai / wrapOpenAI for direct API calls. Use @traceable when you need to trace agent logic around the call or set metadata per invocation.
To trace OpenAI directly, refer to Trace with OpenAI.
Create an agent once before sending traces. Use agent addressing to select its identifier and environment. If an integration requires
project_name, use the selected environment’s tracer_session_name.Setup
Trace API calls
Add metadata
- Python
- TypeScript
Pass
tracing_extra when wrapping the client. The metadata applies to all calls made with that client.Related guides
Some providers have dedicated setup guides that use@traceable or a native callback. These approaches trace at the function level rather than wrapping the client directly, or integrate with the provider’s own SDK and routing layer.
- DeepSeek: OpenAI-compatible API; guide uses
@traceablewith custom provider metadata - LiteLLM: proxy that exposes an OpenAI-compatible endpoint; guide covers
@traceableand LiteLLM’s built-in LangSmith callback
Connect these docs to your agent of choice via MCP for real-time answers.

