Auto-instrument OpenAI SDK calls with Phoenix for complete observability of GPT models, embeddings, and function calling
Phoenix provides auto-instrumentation for the OpenAI Python SDK and OpenAI Node.js SDK, allowing you to trace all calls to OpenAI’s APIs including GPT models, embeddings, and function calling.
Also works with Azure OpenAI: This instrumentation is compatible with Azure OpenAI endpoints.
from phoenix.otel import register# Configure the Phoenix tracertracer_provider = register( project_name="my-llm-app", # Default is 'default' auto_instrument=True # Auto-instrument based on installed packages)
3
Use OpenAI as normal
import openaiclient = openai.OpenAI()response = client.chat.completions.create( model="gpt-4o", messages=[{"role": "user", "content": "Write a haiku about observability."}],)print(response.choices[0].message.content)