<h1 align="center" style="border-bottom: none">
<div>
<a href="https://phoenix.arize.com/?utm_medium=github&utm_content=header_img&utm_campaign=phoenix-client">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Arize-ai/phoenix-assets/refs/heads/main/logos/Phoenix/phoenix.svg">
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/Arize-ai/phoenix-assets/refs/heads/main/logos/Phoenix/phoenix-white.svg">
<img alt="Arize Phoenix logo" src="https://raw.githubusercontent.com/Arize-ai/phoenix-assets/refs/heads/main/logos/Phoenix/phoenix.svg" width="100" />
</picture>
</a>
<br>
arize-phoenix-client
</div>
</h1>
Phoenix Client is a lightweight package for interacting with the Phoenix server.
[](https://pypi.org/project/arize-phoenix-client/)
## Features
- **API** - Interact with Phoenix's OpenAPI REST interface
- **Prompt Management** - Pull / push / and invoke prompts stored in Phoenix
## Installation
Install via `pip`.
```shell
pip install -Uq arize-phoenix-client
```
## Usage
```python
from phoenix.client import Client
client = Client(base_url="your-server-url") # base_url defaults to http://localhost:6006
```
### Authentication (if applicable)
Phoenix API key can be an environment variable...
```python
import os
os.environ["PHOENIX_API_KEY"] = "your-api-key"
```
...or passed directly to the client.
```python
from phoenix.client import Client
client = Client(api_key="your-api-key")
```
### Custom Headers
By default, the Phoenix client will use the bearer authentication scheme in the HTTP headers, but if you need different headers, e.g. for Phoenix Cloud, they can also be customized via an environment variable...
```python
import os
os.environ["PHOENIX_CLIENT_HEADERS"] = "api-key=your-api-key," # use `api-key` for Phoenix Cloud
```
...or passed directly to the client.
```python
from phoenix.client import Client
client = Client(headers={"api-key": "your-api-key"}) # use `api-key` for Phoenix Cloud
```
### Prompt Management
With the Phoenix client, you can push and pull prompts to and from your Phoenix server.
```python
from phoenix.client import Client
from phoenix.client.types import PromptVersion
# Change base_url to your Phoenix server URL
base_url = "http://localhost:6006"
client = Client(base_url=base_url)
# prompt identifier consists of alphanumeric characters, hyphens or underscores
prompt_identifier = "haiku-writer"
content = "Write a haiku about {{topic}}"
prompt = client.prompts.create(
name=prompt_identifier,
version=PromptVersion(
[{"role": "user", "content": content}],
model_name="gpt-4o-mini",
),
)
```
The client can retrieve a prompt by its name.
```python
prompt = client.prompts.get(prompt_identifier=prompt_identifier)
```
The prompt can be used to generate completions.
```python
from openai import OpenAI
variables = {"topic": "programming"}
resp = OpenAI().chat.completions.create(**prompt.format(variables=variables))
print(resp.choices[0].message.content)
```
To learn more about prompt engineering using Phenix, see the [Phoenix documentation](https://arize.com/docs/phoenix/prompt-engineering/how-to-prompts).
Raw data
{
"_id": null,
"home_page": null,
"name": "arize-phoenix-client",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.14,>=3.9",
"maintainer_email": null,
"keywords": "Explainability, Monitoring, Observability",
"author": null,
"author_email": "Arize AI <phoenix-devs@arize.com>",
"download_url": "https://files.pythonhosted.org/packages/39/70/8276394f15c21d24898232e8f556abab330e9ed89a8c55e7d267648e839e/arize_phoenix_client-1.14.2.tar.gz",
"platform": null,
"description": "<h1 align=\"center\" style=\"border-bottom: none\">\n <div>\n <a href=\"https://phoenix.arize.com/?utm_medium=github&utm_content=header_img&utm_campaign=phoenix-client\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/Arize-ai/phoenix-assets/refs/heads/main/logos/Phoenix/phoenix.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/Arize-ai/phoenix-assets/refs/heads/main/logos/Phoenix/phoenix-white.svg\">\n <img alt=\"Arize Phoenix logo\" src=\"https://raw.githubusercontent.com/Arize-ai/phoenix-assets/refs/heads/main/logos/Phoenix/phoenix.svg\" width=\"100\" />\n </picture>\n </a>\n <br>\n arize-phoenix-client\n </div>\n</h1>\n\nPhoenix Client is a lightweight package for interacting with the Phoenix server.\n\n[](https://pypi.org/project/arize-phoenix-client/)\n\n## Features\n\n- **API** - Interact with Phoenix's OpenAPI REST interface\n- **Prompt Management** - Pull / push / and invoke prompts stored in Phoenix\n\n## Installation\n\nInstall via `pip`.\n\n```shell\npip install -Uq arize-phoenix-client\n```\n\n## Usage\n\n```python\nfrom phoenix.client import Client\n\nclient = Client(base_url=\"your-server-url\") # base_url defaults to http://localhost:6006\n```\n\n### Authentication (if applicable)\n\nPhoenix API key can be an environment variable...\n\n```python\nimport os\n\nos.environ[\"PHOENIX_API_KEY\"] = \"your-api-key\"\n```\n\n...or passed directly to the client.\n\n```python\nfrom phoenix.client import Client\n\nclient = Client(api_key=\"your-api-key\")\n```\n\n### Custom Headers\n\nBy default, the Phoenix client will use the bearer authentication scheme in the HTTP headers, but if you need different headers, e.g. for Phoenix Cloud, they can also be customized via an environment variable...\n\n```python\nimport os\n\nos.environ[\"PHOENIX_CLIENT_HEADERS\"] = \"api-key=your-api-key,\" # use `api-key` for Phoenix Cloud\n```\n\n...or passed directly to the client.\n\n```python\nfrom phoenix.client import Client\n\nclient = Client(headers={\"api-key\": \"your-api-key\"}) # use `api-key` for Phoenix Cloud\n```\n\n### Prompt Management\n\nWith the Phoenix client, you can push and pull prompts to and from your Phoenix server.\n\n```python\nfrom phoenix.client import Client\nfrom phoenix.client.types import PromptVersion\n\n# Change base_url to your Phoenix server URL\nbase_url = \"http://localhost:6006\"\nclient = Client(base_url=base_url)\n\n# prompt identifier consists of alphanumeric characters, hyphens or underscores\nprompt_identifier = \"haiku-writer\"\n\ncontent = \"Write a haiku about {{topic}}\"\nprompt = client.prompts.create(\n name=prompt_identifier,\n version=PromptVersion(\n [{\"role\": \"user\", \"content\": content}],\n model_name=\"gpt-4o-mini\",\n ),\n)\n```\n\nThe client can retrieve a prompt by its name.\n\n```python\nprompt = client.prompts.get(prompt_identifier=prompt_identifier)\n```\n\nThe prompt can be used to generate completions.\n\n```python\nfrom openai import OpenAI\n\nvariables = {\"topic\": \"programming\"}\nresp = OpenAI().chat.completions.create(**prompt.format(variables=variables))\nprint(resp.choices[0].message.content)\n```\n\nTo learn more about prompt engineering using Phenix, see the [Phoenix documentation](https://arize.com/docs/phoenix/prompt-engineering/how-to-prompts).\n",
"bugtrack_url": null,
"license": "Elastic-2.0",
"summary": "LLM Observability",
"version": "1.14.2",
"project_urls": {
"Documentation": "https://arize.com/docs/phoenix/",
"Issues": "https://github.com/Arize-ai/phoenix/issues",
"Source": "https://github.com/Arize-ai/phoenix"
},
"split_keywords": [
"explainability",
" monitoring",
" observability"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "880f3b6362355e7fbfed35ac809e6ac3f66daa644a93ca9e23683ac25bb55674",
"md5": "7757ea98e1e5883013279dc5547efe82",
"sha256": "4dfda81b29eb5d718a7c1443cf6b8f67a0b2222e0f54444f74ec182462932ddc"
},
"downloads": -1,
"filename": "arize_phoenix_client-1.14.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7757ea98e1e5883013279dc5547efe82",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.9",
"size": 100964,
"upload_time": "2025-08-05T23:12:31",
"upload_time_iso_8601": "2025-08-05T23:12:31.806305Z",
"url": "https://files.pythonhosted.org/packages/88/0f/3b6362355e7fbfed35ac809e6ac3f66daa644a93ca9e23683ac25bb55674/arize_phoenix_client-1.14.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "39708276394f15c21d24898232e8f556abab330e9ed89a8c55e7d267648e839e",
"md5": "ebdca8cf49638acef8240c913090361a",
"sha256": "fc6ee07e6b09e8c21a83832f76f4c4a4b86ea841427bccc2985b6249d72910f1"
},
"downloads": -1,
"filename": "arize_phoenix_client-1.14.2.tar.gz",
"has_sig": false,
"md5_digest": "ebdca8cf49638acef8240c913090361a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.9",
"size": 96853,
"upload_time": "2025-08-05T23:12:33",
"upload_time_iso_8601": "2025-08-05T23:12:33.033774Z",
"url": "https://files.pythonhosted.org/packages/39/70/8276394f15c21d24898232e8f556abab330e9ed89a8c55e7d267648e839e/arize_phoenix_client-1.14.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-05 23:12:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Arize-ai",
"github_project": "phoenix",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "arize-phoenix-client"
}