> ## Documentation index
> Fetch the complete documentation index at: https://arize.com/llms.txt
> Ask it with GET https://arize.com/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# @arizeai/phoenix-client

[![NPM Version](https://img.shields.io/npm/v/%40arizeai%2Fphoenix-client)](https://www.npmjs.com/package/@arizeai/phoenix-client)

TypeScript client for the [Arize Phoenix](https://github.com/Arize-ai/phoenix) API. Use it to manage prompts, datasets, experiments, spans, sessions, secrets, and raw REST calls against a Phoenix server.

## Installation

```bash
npm install @arizeai/phoenix-client
```

<Note>
`@arizeai/phoenix-client` ships local docs and source code inside `node_modules/@arizeai/phoenix-client/`.

Browse the website version under [@arizeai/phoenix-client Docs](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/overview).
</Note>

## Start Here

- [Package overview](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/overview) for the module map, configuration, and local `node_modules` layout
- [Prompts](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/prompts)
- [Datasets](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/datasets)
- [Experiments](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/experiments)
- [CI Eval Tests](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/ci-evals)
- [Spans](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/spans)
- [Sessions](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/sessions)
- [Secrets](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/secrets)
- [Users](/docs/phoenix/sdk-api-reference/typescript/packages/phoenix-client/users)

## Local Install Pattern

After install, a coding agent can inspect:

```text
node_modules/@arizeai/phoenix-client/docs/
node_modules/@arizeai/phoenix-client/src/
```

That gives the agent version-matched prose plus the exact implementation and type definitions that shipped with your project.

## Agent session capability checks

The client exports a capability requirement for each PXI [agent session](/docs/phoenix/pxi-advanced#conversations) REST route, so a program can confirm a Phoenix server is new enough before calling one. There are eight — `AGENT_SESSION_CREATE`, `AGENT_SESSION_LIST`, `AGENT_SESSION_GET`, `AGENT_SESSION_PATCH`, `AGENT_SESSION_MESSAGES`, `AGENT_SESSION_TOOL_OUTPUTS`, `AGENT_SESSION_COMPACT`, and `AGENT_SESSION_CHAT` — and each requires Phoenix 20.0.0 or newer. Pass one to `ensureServerCapability`, which throws a clear upgrade error against an older server:

```ts
import { createClient, ensureServerCapability, AGENT_SESSION_CHAT } from "@arizeai/phoenix-client";

const client = createClient(); // reads PHOENIX_ENDPOINT / PHOENIX_API_KEY
await ensureServerCapability({ client, requirement: AGENT_SESSION_CHAT });
```

This is the same check the `pxi` terminal client runs at startup before it opens a session.

## API Reference

Use the generated TypeDoc for full API details:

- [TypeScript API docs](https://arize-ai.github.io/phoenix/modules/_arizeai_phoenix-client.html)
