Note*: This instrumentation also works with Azure OpenAI
Install
Setup
Add your OpenAI API key as an environment variable:register function:
Run OpenAI
Observe
Now that you have tracing setup, all invocations of OpenAI (chat completions, completions, the Responses API, embeddings, images, and decisions) will be streamed to your running Phoenix for observability and evaluation.Decisions API
The OpenAI Decisions API (client.decisions.create) asks a decision model a fixed set of typed questions about text or images. It returns one typed, probabilistic answer per question instead of generated text, which makes it a good fit for routing, classification, and scoring inside your application.
Requires openai >= 3.26.0 and openinference-instrumentation-openai >= 0.1.64. Calls are traced with the setup above, with no extra configuration:
input.value: the request body (model,input,questions) as JSONoutput.value: the response body (answers,model,usage) as JSONdecision.system:openaidecision.provider: inferred from the client’s host, soopenai, orazurefor Azure OpenAIdecision.request.model_name,decision.response.model_name, anddecision.model_namedecision.token_count.inputanddecision.token_count.output, from the response’susage
decision.* rather than llm.*, so decision-model calls stay out of Phoenix’s LLM token and cost reporting.
The questions and answers live only in input.value and output.value, so TraceConfig(hide_inputs=True) and hide_outputs=True redact them completely. hide_input_images applies to inline images in the input.

