# Predictions for deployments (Serverless)

> Predictions for deployments (Serverless) - Using a specified endpoint, calculates predictions based
> on user-provided data for a specific deployment.

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.622562+00:00` (UTC).

## Primary page

- [Predictions for deployments (Serverless)](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html): Full documentation for this topic (HTML).

## Sections on this page

- [Request parameters](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#request-parameters): In-page section heading.
- [Headers](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#headers): In-page section heading.
- [Query arguments](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#query-arguments): In-page section heading.
- [Body](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#body): In-page section heading.
- [Response 200](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#response-200): In-page section heading.
- [Binary prediction](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#binary-prediction): In-page section heading.
- [Binary classification example](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#binary-classification-example): In-page section heading.
- [Regression prediction example](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#regression-prediction-example): In-page section heading.
- [Multiclass classification prediction example](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#multiclass-classification-prediction-example): In-page section heading.
- [Errors list](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/dep-pred.html#errors-list): 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.
- [Serverless Prediction API reference](https://docs.datarobot.com/en/docs/api/reference/predapi/pred-ref-serverless/index.html): Linked from this page.
- [Predictions for unstructured model deployments](https://docs.datarobot.com/en/docs/api/reference/predapi/legacy-predapi/pred-ref/dep-pred-unstructured.html): Linked from this page.
- [Deployments > Predictions > Prediction API](https://docs.datarobot.com/en/docs/classic-ui/predictions/realtime/code-py.html): Linked from this page.
- [Deploytab](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/deploy-methods/deploy-model.html#deploy-from-the-leaderboard): Linked from this page.

## Documentation content

Using the endpoint below, you can provide the data necessary to calculate predictions for a specific deployment. If you need to make predictions for an unstructured custom inference model, see [Predictions for unstructured model deployments](https://docs.datarobot.com/en/docs/api/reference/predapi/legacy-predapi/pred-ref/dep-pred-unstructured.html).

Endpoint: `/api/v2/deployments/<deploymentId>/predictions`

Calculates predictions based on user-provided data for a specific deployment. Note that this endpoint works only for deployed models.

> [!NOTE] Note
> You can find the deployment ID in the sample code output of the [Deployments > Predictions > Prediction API](https://docs.datarobot.com/en/docs/classic-ui/predictions/realtime/code-py.html) tab (with Interface set to API Client).

Request Method: `POST`

## Request parameters

### Headers

| Key | Description | Example(s) |
| --- | --- | --- |
| Authorization | Required; string Three methods are supported: Bearer authentication (deprecated) Basic authentication: User_email and API token (deprecated) API token | Example for Bearer authentication method: Bearer API_key-12345abcdb-xyz6789 (deprecated) Example for User_email and API token method: Basic Auth_basic-12345abcdb-xyz6789 (deprecated) Example for API token method: Token API_key-12345abcdb-xyz6789 |
| Content-Type | Optional; string type | text/plain; charset=UTF-8text/csvapplication/jsonmultipart/form-data (for files with data, i.e., .csv, .txt files) |
| Content-Encoding | Optional; string type Currently supports only gzip-encoding with the default data extension. | gzip |
| Accept | Optional; string type Controls the shape of the response schema. Currently JSON(default) and CSV are supported. See examples. | application/json (default)text/csv (for CSV output) |

### Query arguments

| Key | Type | Description | Example(s) |
| --- | --- | --- | --- |
| passthroughColumns | list of strings | (Optional) Controls which columns from a scoring dataset to expose (or copy over) in a prediction response. The request may contain zero, one, or more columns. (There's no limit on how many column names you can pass.) Column names must be passed as UTF-8 bytes and be percent-encoded (see the HTTP standard for this requirement). Make sure to use the exact name of a column as a value. | /api/v2/deployments/<deploymentId>/predictions?passthroughColumns=colA&passthroughColumns=colB |
| passthroughColumnsSet | string | (Optional) Controls which columns from a scoring dataset to expose (or to copy over) in a prediction response. The only possible option is all and, if passed, all columns from a scoring dataset are exposed. | /api/v2/deployments/<deploymentId>/predictions?passthroughColumnsSet=all |
| predictionWarningEnabled | bool | (Optional) DataRobot monitors unusual or anomalous predictions in real-time and indicates when they are detected. If this argument is set to true, a new key is added to each prediction to specify the result of the Humility check. Otherwise, there are no changes in the prediction response. | /api/v2/deployments/<deploymentId>/predictions?predictionWarningEnabled=true Response: { "data": [ { "predictionValues": [ { "value": 18.6948852, "label": "y" } ], "isOutlierPrediction": false, "rowId": 0, "prediction": 18.6948852 } ] } |
| decimalsNumber | integer | (Optional) Configures the float precision in prediction results by setting the number of digits after the decimal point. If there aren't any digits after the decimal point, rather than adding zeros, the float precision is less than the value set by decimalsNumber. | ?decimalsNumber=15 |

> [!NOTE] Note
> The `passthroughColumns` and `passthroughColumnsSet` parameters are mutually exclusive and cannot both be passed in the same request. Also, while there isn't a limit on the number of column names you can pass with the `passthroughColumns` query parameter, there is a limit on the size of the [HTTP request line](https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1) (currently 8192 bytes).

### Body

| Data | Type | Example(s) |
| --- | --- | --- |
| Data to predict | raw text form-data | PassengerId,Pclass,Name,Sex,Age,SibSp,Parch,Ticket,Fare,Cabin,Embarked 892,3,"Kelly, Mr. James",male,34.5,0,0,330911,7.8292,,Q 893,3,"Wilkes, Mrs. James (Ellen Needs)",female,47,1,0,363272,7,,S 894,2,"Myles, Mr. Thomas Francis",male,62,0,0,240276,9.6875,,Q Key: file, value: file_with_data_to_predict.csv |

## Response 200

### Binary prediction

Label: For regression and binary classification tasks, DataRobot API always returns 1 for the positive class and 0 for the negative class. Although the actual values for the classes may be different depending on the data provided (like "yes"/"no"), the DataRobot API will always return 1/0. For multiclass classification, the DataRobot API returns the value itself.

Value: Shows the probability of an event happening (where 0 and 1 are min and max probability, respectively). The user can adjust the threshold that links the value with the prediction label.

PredictionThreshold ( Applicable to binary classification projects only): Threshold is the point that sets the class boundary for a predicted value. The model classifies an observation below the threshold as FALSE, and an observation above the threshold as TRUE. In other words, DataRobot automatically assigns the positive class label to any prediction exceeding the threshold. This can be configured manually through the UI (the [Deploytab](https://docs.datarobot.com/en/docs/classic-ui/mlops/deployment/deploy-methods/deploy-model.html#deploy-from-the-leaderboard)), or through the DataRobot API (i.e., the `PATCH /api/v2/projects/(projectId)/models/(modelId)` route).

The actual response is dependent on the classification task: binary classification, regression or multiclass task.

### Binary classification example

```
{
    "data": [
        {
            "predictionValues": [
                {
                    "value": 0.2789450715,
                    "label": 1
                },
                {
                    "value": 0.7210549285,
                    "label": 0
                }
            ],
            "predictionThreshold": 0.5,
            "prediction": 0,
            "rowId": 0
        }
    ]
}
```

### Regression prediction example

```
{
  "data": [
    {
      "predictionValues": [
        {
          "value": 6754486.5,
          "label": "revenue"
        }
      ],
      "prediction": 6754486.5,
      "rowId": 0
    }
  ]
}
```

### Multiclass classification prediction example

```
{
    "data": [
        {
            "predictionValues": [
                {
                    "value": 0.9999997616,
                    "label": "setosa"
                },
                {
                    "value": 2.433e-7,
                    "label": "versicolor"
                },
                {
                    "value": 1.997631915e-16,
                    "label": "virginica"
                }
            ],
            "prediction": "setosa",
            "rowId": 0
        }
    ]
}
```

## Errors list

| HTTP Code | Sample error message | Reason(s) |
| --- | --- | --- |
| 400 BAD REQUEST | {"message": "Bad request"} | Added external deployments that are unsupported. |
| 404 NOT FOUND | {"message": "Deployment :deploymentId cannot be found for user :userId"} | Provided an invalid :deploymentId (deleted deployment). |
