Skip to main content
Trace an OpenAI call and send it to Arize Phoenix. Background: What are traces. You need a running Phoenix; see Start Phoenix. The example calls OpenAI, so set OPENAI_API_KEY too. Have an existing app? Let your coding agent set it up.

Instrument OpenAI

Register Phoenix as the trace destination and turn on auto-instrumentation. Phoenix instruments every installed OpenInference package it finds, OpenAI here.

Make a call

Any OpenAI call now produces a trace.

Look at the trace

Open the tracing-quickstart project in Phoenix and click the trace: the prompt, response, tokens, and latency are on the span. To trace your own code around the LLM call, wrap it with a decorator or traceChain.

Learn more about traces

Other ways to read your traces: To go deeper on tracing, the Tracing Tutorial covers how to read spans, understand timing, and use trace data to debug and analyze your agent. The code on this page lives in examples/quickstarts, ready to run.