Install
Setup
To instrument your application, import and enableOpenAIInstrumentation
Create the instrumentation.js file:
Run OpenAI
Import theinstrumentation.js file first, then use OpenAI as usual.
Observe
After setting up instrumentation and running your OpenAI application, traces will appear in the Phoenix UI for visualization and analysis. Chat completions, completions, the Responses API, embeddings, and decisions are instrumented.Decisions API
The OpenAI Decisions API (openai.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 >= 7.30.0 and @arizeai/openinference-instrumentation-openai >= 4.4.0. Calls are traced with the setup above, with no extra configuration:
OpenAI Decisions, rather than an LLM span, containing:
input.value: the request body (model,input,questions) as JSONoutput.value: the response body (answers,model,usage) as JSONdecision.systemanddecision.provider: bothopenaidecision.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 the hideInputs and hideOutputs trace config options redact them completely.

