openinference-instrumentation-openai.
This page uses Baseten’s OpenAI-compatible API. There is no separate Baseten-specific OpenInference instrumentor required.
Install
Setup
Add your Baseten API key and the model you want to call, along with your Phoenix connection details, as environment variables:register function:
Run Baseten
Observe
Now that you have tracing set up, all invocations of the OpenAI client pointed at Baseten will be streamed to your running Phoenix for observability and evaluation. Each request appears as aChatCompletion LLM span with the prompt, response, model name, token usage, and latency.
Common Issues
- No traces in Phoenix: Confirm
PHOENIX_COLLECTOR_ENDPOINT(andPHOENIX_API_KEYif your Phoenix requires one) is set in the same shell that runs your app - Baseten spans missing: Call
register()before you create the OpenAI client, and make sureopeninference-instrumentation-openaiis installed soauto_instrument=Truepicks it up 401from Baseten: Use your Baseten API key, not your OpenAI key- Model not found: Confirm
BASETEN_MODELmatches a Baseten model identifier or deployment that supports OpenAI-compatible chat completions - Base URL: Ensure you’re using
https://inference.baseten.co/v1as the base URL

