# Get a prediction server ID

> Get a prediction server ID - Learn how to retrieve a prediction server ID using cURL commands from
> the REST API or by using the DataRobot Python client.

This Markdown file sits beside the HTML page at the same path (with a `.md` suffix). It summarizes the topic and lists links for tools and LLM context.

Companion generated at `2026-05-06T18:17:09.623520+00:00` (UTC).

## Primary page

- [Get a prediction server ID](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-server-id.html): Full documentation for this topic (HTML).

## Sections on this page

- [Documentation](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-server-id.html#documentation): In-page section heading.

## Related documentation

- [Developer documentation](https://docs.datarobot.com/en/docs/api/index.html): Linked from this page.
- [API reference](https://docs.datarobot.com/en/docs/api/reference/index.html): Linked from this page.
- [Prediction API](https://docs.datarobot.com/en/docs/api/reference/predapi/index.html): Linked from this page.
- [Prediction API](https://docs.datarobot.com/en/docs/api/reference/predapi/legacy-predapi/dr-predapi.html): Linked from this page.
- [Create API keys](https://docs.datarobot.com/en/docs/platform/acct-settings/api-key-mgmt.html): Linked from this page.
- [Developer quickstart](https://docs.datarobot.com/en/docs/api/dev-learning/api-quickstart.html): Linked from this page.

## Documentation content

In order to make predictions from a deployment via DataRobot's [Prediction API](https://docs.datarobot.com/en/docs/api/reference/predapi/legacy-predapi/dr-predapi.html), you need a prediction server ID. In this tutorial, you'll learn how to retrieve the ID using cURL commands from the REST API or by using the DataRobot Python client. Once obtained, you can use the prediction server ID to deploy a model and make predictions.

> [!NOTE] Note
> Before proceeding, note that an API key is required for this tutorial. Reference the [Create API keys](https://docs.datarobot.com/en/docs/platform/acct-settings/api-key-mgmt.html) tutorial for more information.

**cURL:**
```
curl -v \
-H "Authorization: Bearer API_KEY" \ YOUR_DR_URL/api/v2/predictionServers/

Example
API_KEY=YOUR_API_KEY
ENDPOINT=YOUR_DR_URL/api/v2/predictionServers/

curl -v \
-H "Authorization: Bearer $API_KEY" \
$ENDPOINT
```

**Python:**
Before continuing with Python, be sure you have installed the DataRobot Python client and configured your connection to DataRobot as outlined in the [Developer quickstart](https://docs.datarobot.com/en/docs/api/dev-learning/api-quickstart.html).

```
# Set up your environment
import os
import datarobot as dr

API_KEY = os.environ["API_KEY"]
YOUR_DR_URL = os.environ["YOUR_DR_URL"]
FILE_PATH = os.environ["FILE_PATH"]
ENDPOINT = YOUR_DR_URL+"/api/v2"

# Instantiate DataRobot instance
dr.Client(
    token=API_KEY,
    endpoint=ENDPOINT
)

prediction_server_id = dr.PredictionServer.list()[0].id
print(prediction_server_id)
```


## Documentation

The following provides additional documentation for features mentioned in this tutorial.

- API key management
- DataRobot Developers portal
- DataRobot Prediction API
