honeyhive[openinference-openai], call HoneyHiveTracer.init(), run OpenAIInstrumentor().instrument(tracer_provider=tracer.provider), and use your existing OpenAI client unchanged. See the tracing quickstart and tracer initialization guides for setup details.
OpenAI provides GPT models for chat completions, embeddings, and more. HoneyHive integrates with OpenAI via the OpenInference instrumentor, automatically capturing all API calls, tool use, and token usage.
How do I trace OpenAI with HoneyHive?
Last tested with
openai 2.30.0 (April 2026).What Gets Traced
The instrumentor automatically captures:- Chat completions -
client.chat.completions.create()with inputs, outputs, and token usage - Tool / function calls - Each tool call with arguments and results
- Embeddings -
client.embeddings.create()requests - Streaming responses - Streamed completions with aggregated tokens
Example: Chat Completion
Environment Configuration
Troubleshooting
Traces not appearing
- Check environment variables - Ensure
HH_API_KEYis set - Pass the tracer provider - The instrumentor must receive
tracer_provider=tracer.provider:
- Initialize before making calls - Call
instrument()before creating the OpenAI client
Related
Enrich Your Traces
Add user IDs and custom metadata to traces
Custom Spans
Create spans for business logic around API calls
Distributed Tracing
Trace calls across service boundaries

