> ## Documentation Index
> Fetch the complete documentation index at: https://arizeai-433a7140.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API Overview

> Start here to call the Phoenix REST API: endpoint setup, authentication, and your first request.

Use the REST API when you want to script Phoenix workflows: creating datasets, running experiments, querying spans, or managing prompts and projects.
Use the API Reference page for the full endpoint list.

<Card title="Full interactive endpoint list" icon="arrow-up-right-from-square" href="/docs/phoenix/sdk-api-reference/rest-api/api-reference">
  Browse every endpoint grouped by resource.
</Card>

## Before You Call The API

<Steps>
  <Step title="Choose your base URL">
    * Phoenix Cloud: `https://app.phoenix.arize.com`
    * Self-hosted Phoenix: your deployment URL (for example `http://localhost:6006`)
  </Step>

  <Step title="Set authentication (if enabled)">
    Use an API key or admin secret in a bearer token header:

    `Authorization: Bearer <your-token>`
  </Step>

  <Step title="Call a v1 endpoint">
    All REST endpoints are under `/v1/...`.
  </Step>
</Steps>

<Note>
  If authentication is disabled in your self-hosted deployment, you can omit the `Authorization` header.
</Note>

## First Request

The example below lists projects and includes common pagination query params.

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl --request GET \
      --url "$PHOENIX_BASE_URL/v1/projects?limit=10" \
      --header "Authorization: Bearer $PHOENIX_API_KEY"
    ```
  </Tab>

  <Tab title="JavaScript" icon="js">
    ```javascript theme={null}
    const baseUrl = process.env.PHOENIX_BASE_URL;
    const apiKey = process.env.PHOENIX_API_KEY;

    const response = await fetch(
      `${baseUrl}/v1/projects?limit=10`,
      {
        headers: {
          Authorization: `Bearer ${apiKey}`,
        },
      }
    );

    const body = await response.json();
    console.log(body.data);
    ```
  </Tab>

  <Tab title="Python" icon="python">
    ```python theme={null}
    import os
    import requests

    base_url = os.environ["PHOENIX_BASE_URL"]
    api_key = os.environ.get("PHOENIX_API_KEY")
    headers = {"Authorization": f"Bearer {api_key}"} if api_key else {}

    response = requests.get(
        f"{base_url}/v1/projects",
        params={"limit": 10},
        headers=headers,
        timeout=30,
    )
    response.raise_for_status()

    body = response.json()
    print(body["data"])
    ```
  </Tab>
</Tabs>

## Response Pattern

Most list endpoints return a shape like:

```json theme={null}
{
  "data": [],
  "next_cursor": null
}
```

When `next_cursor` is not `null`, pass it back as the `cursor` query param to fetch the next page.

## Where To Go Next

<CardGroup cols={2}>
  <Card title="Projects" href="/docs/phoenix/sdk-api-reference/rest-api/api-reference/projects/list-all-projects" icon="folder">
    Start by listing projects and finding your project identifier.
  </Card>

  <Card title="Spans" href="/docs/phoenix/sdk-api-reference/rest-api/api-reference/spans/list-spans-with-simple-filters-no-dsl" icon="list-ul">
    Query spans for a project.
  </Card>

  <Card title="Datasets" href="/docs/phoenix/sdk-api-reference/rest-api/api-reference/datasets/list-datasets" icon="database">
    Create and manage evaluation datasets.
  </Card>

  <Card title="Prompts" href="/docs/phoenix/sdk-api-reference/rest-api/api-reference/prompts/list-all-prompts" icon="file-code">
    Manage prompt versions and tags.
  </Card>
</CardGroup>
