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 Arize AX captures each request through openinference-instrumentation-openai.
This page uses Baseten’s OpenAI-compatible API. There is no separate Baseten-specific OpenInference instrumentor required.

Prerequisites

  • Python 3.9+
  • An Arize AX account (sign up)
  • A Baseten API key
  • A deployed Baseten model or model identifier that supports the OpenAI-compatible chat completions API

Launch Arize

  1. Sign in to your Arize AX account.
  2. From Space Settings, copy your Space ID and API Key. You will set them as ARIZE_SPACE_ID and ARIZE_API_KEY below.

Install

Configure credentials

Setup tracing

Run Baseten

Expected output

Verify in Arize

  1. Open your Arize AX space and select project baseten-tracing-example.
  2. You should see a new trace within ~30 seconds containing a ChatCompletion LLM span with prompt, response, model, latency, and token metadata.
  3. If no traces appear, see Troubleshooting.

Check from the skill, CLI, or SDK

Confirm spans are actually reaching your Arize AX project. Use whichever fits your workflow — the skill and CLI work for any framework; the SDK check is shown for each language.
Install the Arize Skills plugin and let your coding agent check for you:
Then prompt your agent:
Use the arize-trace skill to export and analyze recent traces from my project. Confirm spans are arriving, and summarize any errors or latency issues.

Troubleshooting

  • No traces in Arize. Confirm ARIZE_SPACE_ID and ARIZE_API_KEY are set in the same shell that runs example.py.
  • Baseten spans missing but other spans present. OpenAIInstrumentor().instrument(...) must run before any import openai.
  • 401 from Baseten. Use your Baseten API key, not your OpenAI or Arize API key.
  • Model not found. Confirm BASETEN_MODEL matches a Baseten model identifier or deployment that supports OpenAI-compatible chat completions.

Resources

Baseten Model APIs

OpenInference OpenAI Instrumentor

LLM Evaluation Guide

Agent Evaluation Guide