Skip to main content
Baseten serves foundation models and custom model deployments through OpenAI-compatible APIs. Point the OpenAI Python client at Baseten’s inference endpoint and Phoenix captures each request through 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:
Connect your application to Phoenix with the 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 a ChatCompletion LLM span with the prompt, response, model name, token usage, and latency.

Common Issues

  • No traces in Phoenix: Confirm PHOENIX_COLLECTOR_ENDPOINT (and PHOENIX_API_KEY if 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 sure openinference-instrumentation-openai is installed so auto_instrument=True picks it up
  • 401 from Baseten: Use your Baseten API key, not your OpenAI key
  • Model not found: Confirm BASETEN_MODEL matches a Baseten model identifier or deployment that supports OpenAI-compatible chat completions
  • Base URL: Ensure you’re using https://inference.baseten.co/v1 as the base URL

Resources

Baseten Model APIs

OpenInference OpenAI Instrumentation