Arize (arize SDK)
Python SDK for interacting with Arize AX — Arize's enterprise AI engineering platform. IMPORTANT: The 'arize' package covers two separate product tracks with distinct APIs that coexist in the same package. (1) arize.api.Client / arize.ml — the v7 legacy ML monitoring SDK for logging predictions, actuals, embeddings, and drift data to the Arize ML platform. (2) arize.ArizeClient — the v8 LLM/agent observability API for tracing spans, evaluations, and datasets. v7 and v8 are NOT interchangeable. v7 support ends June 1, 2026. Also note: 'arize-phoenix' is a SEPARATE package — Phoenix is Arize's open-source observability tool. Do not conflate arize (enterprise cloud) with arize-phoenix (OSS self-hosted).
Common errors
-
ModuleNotFoundError: No module named 'arize'
cause The 'arize' package is not installed in the Python environment.fixInstall the package using pip: 'pip install arize'. -
ImportError: cannot import name 'ArizeClient' from 'arize'
cause Attempting to import 'ArizeClient' from an older version of the 'arize' package that does not include this class.fixUpgrade to the latest version of the 'arize' package: 'pip install --upgrade arize'. -
TypeError: 'NoneType' object is not iterable
cause The 'context.span_id' column is missing or contains None values when updating metadata using the 'update_metadata' method.fixEnsure the 'context.span_id' column exists and contains valid span IDs in the DataFrame before calling 'update_metadata'. -
ValueError: Invalid API key
cause An incorrect or missing API key is provided when initializing the 'ArizeClient'.fixProvide a valid API key when initializing the client: 'client = ArizeClient(api_key="your-api-key")'. -
AttributeError: module 'arize' has no attribute 'pandas'
cause The 'arize.pandas' module is not available in the installed version of the 'arize' package.fixEnsure you are using the correct import statement: 'from arize.pandas.logger import Client, Schema'.
Warnings
- breaking v7 (arize.api.Client) and v8 (arize.ArizeClient) are architecturally different and not interchangeable. v7 Client requires space_id at construction and uses space_key. v8 ArizeClient requires only api_key at construction and uses space_id per-call. Tutorials and StackOverflow answers referencing from arize.api import Client with space_key= are v7 patterns. v7 EOL is June 1, 2026.
- breaking 'arize' (this package) and 'arize-phoenix' are DIFFERENT products on PyPI. arize = enterprise Arize AX cloud platform. arize-phoenix = open-source self-hosted observability platform (Phoenix). They share the Arize AI org, OpenInference instrumentors, and some API patterns — but they are separate services, separate credentials, and separate packages. pip install arize does NOT install Phoenix. pip install arize-phoenix does NOT include the Arize AX client.
- gotcha A dependency in the openinference ecosystem had a broken dependency on 'phoenix-client' (non-existent on PyPI) instead of 'arize-phoenix-client'. This caused 'No matching distribution found for phoenix-client' install failures in affected versions (reported Feb 2026). The bug was in openinference packages, not arize directly.
- gotcha arize[Tracing] installs the arize-otel package as an extra. If you only need OTel registration without the full arize SDK (for Phoenix or other backends), install arize-otel directly instead. Both arize.otel and phoenix.otel expose a register() function with identical signatures — mixing them in the same codebase sends to different backends.
Install
-
pip install arize -
pip install 'arize[Tracing]' -
pip install 'arize[NLP_Metrics]'
Imports
- ArizeClient (v8)
from arize.api import Client
from arize import ArizeClient
- Client (v7 legacy ML)
from arize import Client
from arize.api import Client
- register (OTel tracing)
from arize import register
from arize.otel import register
Quickstart
import os
from arize import ArizeClient
# v8 API: ArizeClient takes only api_key at init
client = ArizeClient(api_key=os.environ['ARIZE_API_KEY'])
SPACE_ID = os.environ['ARIZE_SPACE_ID']
PROJECT_NAME = 'my-llm-app'
# Log spans from a dataframe
# spans_df must be a pandas DataFrame with OTel-compatible columns
client.spans.log(
space_id=SPACE_ID,
project_name=PROJECT_NAME,
dataframe=spans_df
)
# Log evaluations separately
client.spans.update_evaluations(
space_id=SPACE_ID,
project_name=PROJECT_NAME,
dataframe=evals_df
)
# Export spans back out
from datetime import datetime
df = client.spans.export_to_df(
space_id=SPACE_ID,
project_name=PROJECT_NAME,
start_time=datetime(2025, 1, 1),
end_time=datetime(2026, 1, 1)
)
# OTel tracing (auto-instrument your app to send spans live)
from arize.otel import register
tracer_provider = register(
space_id=SPACE_ID,
api_key=os.environ['ARIZE_API_KEY'],
project_name=PROJECT_NAME
)
# After register(), OTel-compatible instrumentors (OpenInference)
# will auto-export spans to Arize
from openinference.instrumentation.openai import OpenAIInstrumentor
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)