Add your OpenAI API key as an environment variable:
export OPENAI_API_KEY=[your_key_here]
Use the register function to connect your application to Phoenix:
from phoenix.otel import register# configure the Phoenix tracertracer_provider = register( project_name="my-llm-app", # Default is 'default' auto_instrument=True # Auto-instrument your app based on installed dependencies)
Now that you have tracing setup, all invocations of OpenAI (completions, chat completions, embeddings) will be streamed to your running Phoenix for observability and evaluation.