{"id":4882,"library":"arize-phoenix-client","title":"Arize Phoenix Client","description":"The Arize Phoenix Client is a lightweight Python package designed for interacting with the Phoenix platform via its OpenAPI REST interface. It enables users to programmatically manage datasets, run experiments, analyze traces, and collect feedback, primarily focusing on LLM observability. The library is actively maintained with frequent updates.","status":"active","version":"2.3.1","language":"en","source_language":"en","source_url":"https://github.com/Arize-ai/phoenix","tags":["LLM","observability","tracing","AI","ML","evaluation","client"],"install":[{"cmd":"pip install arize-phoenix-client","lang":"bash","label":"Install latest client"}],"dependencies":[{"reason":"Required Python version for the library.","package":"python","version":">=3.10, <3.15"},{"reason":"Often installed alongside for LLM evaluation capabilities.","package":"arize-phoenix-evals","version":">=2","optional":true}],"imports":[{"note":"The top-level module for imports is `phoenix`, not `arize_phoenix`.","wrong":"from arize_phoenix.client import Client","symbol":"Client","correct":"from phoenix.client import Client"},{"symbol":"AsyncClient","correct":"from phoenix.client import AsyncClient"}],"quickstart":{"code":"import os\nfrom phoenix.client import Client\nimport pandas as pd\n\n# Configure Phoenix Client using environment variables or directly\n# For local Phoenix server (default): export PHOENIX_BASE_URL=\"http://localhost:6006\"\n# For Phoenix Cloud: export PHOENIX_API_KEY=\"your-api-key\" and export PHOENIX_BASE_URL=\"https://app.phoenix.arize.com/s/your-space\"\n# Ensure PHOENIX_BASE_URL is set, or pass it directly.\n\n# Example: Directly configuring for a local server, ensure a Phoenix server is running.\nclient = Client(base_url=os.environ.get('PHOENIX_BASE_URL', 'http://localhost:6006'))\n\ntry:\n    # Create a simple DataFrame\n    df = pd.DataFrame({\n        \"question\": [\n            \"What is the capital of France?\",\n            \"Who wrote Hamlet?\"\n        ],\n        \"answer\": [\n            \"Paris\",\n            \"William Shakespeare\"\n        ]\n    })\n\n    # Create a dataset in Phoenix\n    dataset_name = \"my-qa-dataset\"\n    dataset = client.datasets.create_dataset(\n        name=dataset_name,\n        dataframe=df,\n        input_keys=[\"question\"],\n        output_keys=[\"answer\"]\n    )\n\n    print(f\"Successfully created dataset: {dataset.name} with {len(dataset)} examples.\")\n\n    # Retrieve the dataset\n    retrieved_dataset = client.datasets.get_dataset(dataset=dataset_name)\n    print(f\"Retrieved dataset: {retrieved_dataset.name}.\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure the Phoenix server is running and accessible at the specified base_url.\")","lang":"python","description":"This quickstart demonstrates how to initialize the Phoenix client and interact with datasets. It shows how to create a dataset from a Pandas DataFrame and then retrieve it. Ensure your Phoenix server is running and accessible, and configure `PHOENIX_BASE_URL` and `PHOENIX_API_KEY` (if using cloud) via environment variables or directly in the `Client` constructor."},"warnings":[{"fix":"Migrate your code to use `from phoenix.client import Client`. The `endpoint` parameter for initialization is now `base_url`. Client methods are now organized under resource namespaces (e.g., `client.spans`, `client.traces`, `client.datasets`) instead of being flat on the client object. Refer to the official migration guide for a detailed mapping.","message":"The legacy `phoenix.session.client.Client` (accessed as `px.Client()`) has been removed in `arize-phoenix 14.0.0` (corresponding to `arize-phoenix-client 2.3.1+`). All client interactions must now use `from phoenix.client import Client`.","severity":"breaking","affected_versions":"arize-phoenix 14.0.0+, arize-phoenix-client 2.3.1+"},{"fix":"Update your evaluation workflows to use the latest evaluation API. This means the `legacy/` subpackage and its models/wrappers, `MultimodalPrompt`, `PromptPartContentType`, and `PromptPart` types are no longer available. All adapter methods now use `PromptLike`. The `/v1/evaluations` endpoint is also removed.","message":"Evals 1.0 and the legacy experiments module have been removed. This affects `arize-phoenix-evals 3.0.0` and `arize-phoenix-client 2.3.1+`.","severity":"breaking","affected_versions":"arize-phoenix-client 2.3.1+, arize-phoenix-evals 3.0.0+"},{"fix":"Replace calls to `client.annotations.add_span_annotation()` or `client.annotations.log_span_annotations()` with `client.spans.add_span_annotation()` and `client.spans.log_span_annotations()` respectively.","message":"The `client.annotations` module was removed. Its functionality has been integrated into `client.spans`.","severity":"deprecated","affected_versions":"arize-phoenix-client 2.0.0+"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}