---
schema_version: "1"
id: 0c31296fbeecc71d44fffe78155ba2104f7faf62d632cc6a641f8864cd3a133b
title: Models API REST
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce/references/generated-api-specs/models-api.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce/references/models-api
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4850c3b0fc086e80431ee5b95ef9938c629336cb40686e61afce1f231951c499
products:
  - Agentforce Developer Guide
  - Agentforce and Einstein Generative AI
---
Models API REST

# Models API REST

The Models REST API connects your application to large language models (LLMs) through the Einstein Trust Layer. To get started, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).

### Postman Collection

The quickest way to get started with the Models REST API is with our [Postman collection](https://www.postman.com/salesforce-developers/workspace/salesforce-developers/collection/12721794-582bb775-b99d-46d8-88cf-df0d3a341040).

### Endpoints

*   [Generate Chat](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/generateChat): Generate a response based on a list of messages representing a chat conversation.
*   [Generate Embeddings](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/generateEmbeddings): Create an embedding vector representing the input text.
*   [Generate Text](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/generateText): Generate a response based on the provided prompt.
*   [Submit Feedback](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/submitFeedback): Submit feedback for generated text.

### Predictive Endpoints

These endpoints call a deployed predictive model (built in AI Models in Data 360) by its API name. Passing an LLM model name returns a `403 RBAC: access denied` error.

*   [Regression](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/predictRegression): Predicts a continuous numeric value from a set of input variables.
*   [Binary Classification](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/predictClassification): Predicts a probability for one of two classes from a set of input variables.
*   [Multiclass Classification](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/predictMultiOutcome): Predicts a probability for each of three or more classes from a set of input variables.
*   [Sentiment Detection](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/detectSentiment): Analyzes each text to determine a sentiment label and score.
*   [Topic Classification](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/classifyTopics): Classifies each text into one or more user-defined topics (zero-shot).
*   [Forecast](https://developer.salesforce.com/docs/ai/agentforce/references/models-api#operation/forecast): Forecasts future values of a time series.

**Version:** v1

## Servers

*   `https://api.salesforce.com/einstein/platform/v1` The Salesforce API Platform (SFAP) server.

## Security

*   `orgJWT` (http) JSON web token (JWT) from your org. Header format: `Authorization: Bearer <OrgJWT>`. For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).
    *   HTTP scheme: bearer (JWT)

## Operations

### POST Generate chat

`POST /models/{modelName}/chat-generations`

Operation ID: `generateChat`. Security: orgJWT.

Generate a response based on a list of messages representing a chat conversation.

#### Parameters

*   `modelName` (path, string, required) Configured model name.
*   `Authorization` (header, string, required) Authorization information that contains the JWT. For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer •••••`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) This value is reserved for future use. For now, specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.

#### Request body (required)

Media type: `application/json;charset=utf-8`. Schema: `ChatGenerationsRequest`.

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `ChatGenerationsResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Generate embeddings

`POST /models/{modelName}/embeddings`

Operation ID: `generateEmbeddings`. Security: orgJWT.

Create an embedding vector representing the input text.

#### Parameters

*   `modelName` (path, string, required) Configured model name.
*   `Authorization` (header, string, required) Authorization information that contains the JWT. For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer •••••`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) This value is reserved for future use. For now, specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.

#### Request body (required)

Media type: `application/json;charset=utf-8`. Schema: `EmbeddingRequest`.

_Example: example1_ Give yourself a present

```
{
  "input": [
    "Every day, once a day, give yourself a present"
  ]
}
```

#### Responses

*   **200** OK
    
    Headers:
    
    *   `date` (string)  
        Example: `Fri, 18 Aug 2023 03:10:42 GMT`.
    *   `content-type` (string)  
        Example: `application/json`.
    *   `x-request-id` (string)  
        Example: `51633d74-bdd1-42b0-9ea6-518eb9346d18`.
    *   `x-b3-traceid` (string)  
        Example: `ce8728ae2ad06aff48f8e19132aaeeaf`.
    *   `x-b3-spanid` (string)  
        Example: `1c8ace90f95631a9`.
    *   `x-envoy-upstream-service-time` (integer)  
        Example: `923`.
    *   `transfer-encoding` (string)  
        Example: `chunked`.
    
    Media type: `application/json`. Schema: `EmbeddingResponse`.
    
    _Example: example1_ Give yourself a present: Success
    
    Note: Embedding array truncated to 1 item for brevity.
    
    ```
    {
      "embeddings": [
        {
          "embedding": [
            0.0015662104
          ],
          "index": 0
        }
      ],
      "parameters": {
        "usage": {
          "prompt_tokens": 11,
          "total_tokens": 11
        },
        "model": "text-embedding-ada-002-v2",
        "object": "list"
      }
    }
    ```
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Generate text

`POST /models/{modelName}/generations`

Operation ID: `generateText`. Security: orgJWT.

Generate a response based on the provided prompt.

#### Parameters

*   `modelName` (path, string, required) Configured model name.  
    Example: `sfdc_ai__DefaultAzureOpenAIGPT35Turbo`.
*   `Authorization` (header, string, required) Authorization information that contains the JWT. For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer •••••`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) This value is reserved for future use. For now, specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.

#### Request body (required)

Media type: `application/json;charset=utf-8`. Schema: `GenerationRequest`.

#### Responses

*   **200** OK
    
    Headers:
    
    *   `content-type` (string)  
        Example: `application/json`.
    *   `content-length` (integer)  
        Example: `1149`.
    
    Media type: `application/json`. Schema: `GenerationResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Submit feedback

`POST /feedback`

Operation ID: `submitFeedback`. Security: orgJWT.

Submit feedback for generated text.

#### Parameters

*   `Authorization` (header, string, required) Authorization information that contains the JWT. For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer •••••`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) This value is reserved for future use. For now, specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.

#### Request body (required)

Media type: `application/json`. Schema: `FeedbackRequest`.

#### Responses

*   **202** Accepted
    
    Headers:
    
    *   `content-type` (string)  
        Example: `application/json`.
    *   `content-length` (integer)  
        Example: `1149`.
    
    Media type: `application/json`. Schema: `object`.
    
    *   `message` (_string_)
    
    _Example: example1_
    
    ```
    {
      "message": "Feedback received, Thank you!"
    }
    ```
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Predict a number (regression)

`POST /models/{modelApiName}/regression`

Operation ID: `predictRegression`. Security: orgJWT.

Predict a continuous numeric value from a set of input variables. Call a deployed predictive model by its API name.

#### Parameters

*   `modelApiName` (path, string, required) API name of your deployed predictive model (built in AI Models in Data 360). Passing an LLM model name returns a `403 RBAC: access denied` error.
*   `Authorization` (header, string, required) OAuth 2.0 access token (client-credentials flow). For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer <ACCESS_TOKEN>`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) Feature identifier. Specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.
*   `x-client-trace-id` (header, string) Recommended. A UUID that's echoed in logs for troubleshooting.  
    Example: `a-uuid`.

#### Request body (required)

Media type: `application/json`. Schema: `RegressionRequest`.

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `RegressionResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Predict one of two categories (binary)

`POST /models/{modelApiName}/classification`

Operation ID: `predictClassification`. Security: orgJWT.

Predict a probability for one of two classes from a set of input variables. Call a deployed predictive model by its API name.

#### Parameters

*   `modelApiName` (path, string, required) API name of your deployed predictive model (built in AI Models in Data 360). Passing an LLM model name returns a `403 RBAC: access denied` error.
*   `Authorization` (header, string, required) OAuth 2.0 access token (client-credentials flow). For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer <ACCESS_TOKEN>`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) Feature identifier. Specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.
*   `x-client-trace-id` (header, string) Recommended. A UUID that's echoed in logs for troubleshooting.  
    Example: `a-uuid`.

#### Request body (required)

Media type: `application/json`. Schema: `ClassificationRequest`.

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `ClassificationResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Predict one of multiple categories (multiclass)

`POST /models/{modelApiName}/multi-outcome`

Operation ID: `predictMultiOutcome`. Security: orgJWT.

Predict a probability for each of three or more classes from a set of input variables. Call a deployed predictive model by its API name.

#### Parameters

*   `modelApiName` (path, string, required) API name of your deployed predictive model (built in AI Models in Data 360). Passing an LLM model name returns a `403 RBAC: access denied` error.
*   `Authorization` (header, string, required) OAuth 2.0 access token (client-credentials flow). For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer <ACCESS_TOKEN>`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) Feature identifier. Specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.
*   `x-client-trace-id` (header, string) Recommended. A UUID that's echoed in logs for troubleshooting.  
    Example: `a-uuid`.

#### Request body (required)

Media type: `application/json`. Schema: `MultiOutcomeRequest`.

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `MultiOutcomeResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Detect sentiment

`POST /models/{modelApiName}/sentiment-detection`

Operation ID: `detectSentiment`. Security: orgJWT.

Analyze each text to determine a sentiment label and score. Call a deployed predictive model by its API name.

#### Parameters

*   `modelApiName` (path, string, required) API name of your deployed predictive model (built in AI Models in Data 360). Passing an LLM model name returns a `403 RBAC: access denied` error.
*   `Authorization` (header, string, required) OAuth 2.0 access token (client-credentials flow). For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer <ACCESS_TOKEN>`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) Feature identifier. Specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.
*   `x-client-trace-id` (header, string) Recommended. A UUID that's echoed in logs for troubleshooting.  
    Example: `a-uuid`.

#### Request body (required)

Media type: `application/json`. Schema: `BatchSentimentRequest`.

_Example: example1_

```
{
  "texts": [
    "I love this product, it's amazing!",
    "Worst purchase ever."
  ]
}
```

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `BatchSentimentResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Classify topics

`POST /models/{modelApiName}/topic-classification`

Operation ID: `classifyTopics`. Security: orgJWT.

Classify each text into one or more user-defined topics (zero-shot). This capability uses the candidate labels you provide, so no per-topic training is required. Call a deployed predictive model by its API name.

#### Parameters

*   `modelApiName` (path, string, required) API name of your deployed predictive model (built in AI Models in Data 360). Passing an LLM model name returns a `403 RBAC: access denied` error.
*   `Authorization` (header, string, required) OAuth 2.0 access token (client-credentials flow). For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer <ACCESS_TOKEN>`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) Feature identifier. Specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.
*   `x-client-trace-id` (header, string) Recommended. A UUID that's echoed in logs for troubleshooting.  
    Example: `a-uuid`.

#### Request body (required)

Media type: `application/json`. Schema: `TopicClassificationRequest`.

_Example: example1_

```
{
  "texts": [
    "My bill is wrong and I was charged twice"
  ],
  "topicLabels": [
    "Billing",
    "Login Issue",
    "Shipping",
    "Feature Request"
  ]
}
```

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `TopicClassificationResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Forecast

`POST /models/{modelApiName}/forecast`

Operation ID: `forecast`. Security: orgJWT.

Forecast future values for a specified time horizon. Call a deployed predictive model by its API name.

#### Parameters

*   `modelApiName` (path, string, required) API name of your deployed predictive model (built in AI Models in Data 360). Passing an LLM model name returns a `403 RBAC: access denied` error.
*   `Authorization` (header, string, required) OAuth 2.0 access token (client-credentials flow). For guidance, see [Access Models API with REST](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-rest.html).  
    Example: `Bearer <ACCESS_TOKEN>`.
*   `x-sfdc-app-context` (header, string, required) This value is reserved for future use. For now, specify `EinsteinGPT`.  
    Example: `EinsteinGPT`.
*   `x-client-feature-id` (header, string, required) Feature identifier. Specify `ai-platform-models-connected-app`.  
    Example: `ai-platform-models-connected-app`.
*   `x-client-trace-id` (header, string) Recommended. A UUID that's echoed in logs for troubleshooting.  
    Example: `a-uuid`.

#### Request body (required)

Media type: `application/json`. Schema: `ForecastRequest`.

_Example: example1_

```
{
  "trainColumns": [
    {
      "columnName": "ds",
      "columnType": "TIMESTAMP",
      "values": {
        "valueType": "TIMESTAMP",
        "values": [
          "2024-01-01T00:00:00",
          "2024-02-01T00:00:00",
          "2024-03-01T00:00:00"
        ]
      }
    },
    {
      "columnName": "sales",
      "columnType": "ENDOGENOUS",
      "values": {
        "valueType": "DOUBLE",
        "values": [
          100,
          120,
          130
        ]
      }
    }
  ],
  "frequency": "MONTHLY",
  "numberOfForecasts": 2,
  "confidenceInterval": 0.95
}
```

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `ForecastResponse`.
    
*   **400** Bad Request
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "REQUIRED_FIELD_MISSING",
      "messageCode": "EXXXXX",
      "message": "Field is required"
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INVALID_AUTH",
      "messageCode": "EXXXXX",
      "message": "Access bearer token is missing or invalid"
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "User forbidden from accessing the resource"
    }
    ```
    
*   **404** Resource not found or auth token is invalid
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Resource not found"
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "NOT_FOUND",
      "messageCode": "EXXXXX",
      "message": "Server is busy and cannot process the request at this time"
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "LIMIT_EXCEEDED",
      "messageCode": "EXXXXX",
      "message": "Too many requests for the server to handle"
    }
    ```
    
*   **500** Internal server error
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Internal server error"
    }
    ```
    
*   **503** Service is unavailable
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "errorCode": "INTERNAL_ERROR",
      "messageCode": "EXXXXX",
      "message": "Service is unavailable"
    }
    ```
    
*   **default** Something went wrong
    
    Media type: `application/json`. Schema: `Error`.
    

## Schemas

### ChatGenerationsRequest

A chat generation request.

*   `messages` (_array of ChatMessageRequest_, required) List of messages to send to the model. These messages should be in chronological order.
*   `localization` (_Localization_)
*   `tags` (_Tags_)

### ChatGenerationsResponse

A chat generation response.

*   `id` (_ResponseId_, required)
*   `generationDetails` (_GenerationDetails_, required)

### Error

Models API error.

*   `errorCode` (_string_, required) Error code to map the error message  
    Example: `INTERNAL_ERROR`.
*   `messageCode` (_string_, required) The messageCode field is a specification of the error and uniquely identifies an error message.  
    Example: `E00001`.
*   `message` (_string_, required) Description of the error.  
    Example: `A generic error emitted by the API platform and mapped to the 500 HTTP status code`.
*   `targets` (_array of object_) A collection of references that represent the specific occurrence of the problem.
    *   `type` (_string_) FIELD | QUERY\_PARAMETER | HTTP\_HEADER  
        Example: `FIELD`.
    *   `reference` (_string_)  
        Example: `$['order']['payment']['billingAddress']['postalCode']`.
*   `parameters` (_array of object_) A collection of name-value pairs where each item in the collection represents a parameter leveraged in the error message.
    *   `name` (_string_)  
        Example: `postalCode`.
    *   `value` (_string_)  
        Example: `123456789`.

### EmbeddingRequest

An embedding request.

*   `input` (_array of string_, required) Input text used for generating an embedding. Data is encoded as an array of strings.
*   `localization` (_Localization_)
*   `tags` (_Tags_)

### EmbeddingResponse

An embedding response.

*   `embeddings` (_array of Embeddings_) Array of `Embeddings` in the response.
*   `parameters` (_object_) Any provider-specific attributes are included as part of this object.
    
    _Example_
    
    ```
    {
      "texts": [
        "input"
      ]
    }
    ```
    

### GenerationRequest

A generation request.

*   `prompt` (_string_, required) The prompt or text to be completed.  
    Example: `Invent 3 fun names for donuts`.
*   `localization` (_Localization_)
*   `tags` (_Tags_)

### GenerationResponse

A generation response.

*   `id` (_string_, required) ID of the generation request.  
    Example: `chatcmpl-8diKGsPooFDwwhbJxmibpUc7437at`.
*   `generation` (_GenerationRepresentation_, required)
*   `moreGenerations` (_array of GenerationRepresentation_) List of generated text items if the number of requested generations is greater than one.
*   `prompt` (_string_, nullable) Prompt used for the generation. Can be `null`.  
    Example: `Invent 3 fun names for donuts`.
*   `parameters` (_object_, nullable) Any provider-specific attributes included as part of this object. Can be `null`.
    
    _Example_
    
    ```
    {
      "model": "gpt-3.5-turbo-0125",
      "object": "chat.completion",
      "usage": {
        "prompt_tokens": 14,
        "completion_tokens": 15,
        "total_tokens": 29
      }
    }
    ```
    

### FeedbackRequest

A feedback request.

*   `id` (_string_) A unique ID for the feedback object.  
    Example: `d123449d-afed-4abe-9a0e-19c90726d2ea`.
*   `generationId` (_string_) Identifies the target of this feedback data. You can specify the ID of a `/generations` response, or use any other identifier as a string value. The Models API doesn’t do any semantic validation on this field and it’s only meant for you to identify this information in the datastore.  
    Example: `d321449d-afed-4abe-9a0e-19c90726d2ea`.
*   `feedback` (_string_, nullable) The feedback sentiment. Can be `null`.  
    Allowed values: `GOOD`, `BAD`.
*   `feedbackText` (_string_) The textual representation of the feedback as provided by the user.
*   `source` (_string_) The source of the feedback. For example, `human` or `app`.
*   `appFeedback` (_object_) Dictionary of any app-level feedback and any other free-form parameters.
*   `appGenerationId` (_string_) App-specific generation ID to support cases where the client has multiple responses in a single generation.
*   `appGeneration` (_string_) App-specific generation text to support cases where the client has multiple responses in a single generation.  
    Example: `d567849d-afed-4abe-9a0e-19c90726d2ea`.

### RegressionRequest

A regression request.

*   `predictionColumns` (_array of Column_, required) Input records provided as columns of parallel arrays: the values at index `i` across every column forms record `i`.
*   `settings` (_object_)
    *   `maxTopContributors` (_integer_) Max contributing factors to return per prediction.  
        Minimum: 0. Maximum: 50.
    *   `maxPrescriptions` (_integer_) Max prescriptions ("what to change") per prediction.  
        Minimum: 0. Maximum: 5.
    *   `prescriptionThreshold` (_number_) Min prescription impact (fraction) to include.  
        Minimum: 0. Maximum: 1.

### RegressionResponse

A regression response. `results` is positional: `results[i]` is the outcome for record `i`.

*   `results` (_array of RegressionResult_)

### ClassificationRequest

Request to generate classification predictions.

*   `predictionColumns` (_array of Column_, required) Input records provided as columns of parallel arrays: the values at index `i` across every column forms record `i`.
*   `settings` (_object_)
    *   `maxTopContributors` (_integer_) Maximum number of contributing factors to return.  
        Minimum: 0. Maximum: 50.

### ClassificationResponse

A classification response that contains classification results. `results` is positional: `results[i]` is the outcome for record `i`.

*   `results` (_array of ClassificationResult_)

### MultiOutcomeRequest

A request to generate multiclass predictions. This capability doesn't require any settings.

*   `predictionColumns` (_array of Column_, required) Input records provided as columns of parallel arrays: the values at index `i` across every column forms record `i`.

### MultiOutcomeResponse

Response containing multiclass classification results. `results` is positional: `results[i]` is the outcome for record `i`.

*   `results` (_array of MultiOutcomeResult_)

### BatchSentimentRequest

A batch sentiment request.

*   `texts` (_array of string_, required) The texts to score. `responses[i]` corresponds to `texts[i]`.

### BatchSentimentResponse

A batch sentiment response.

*   `responses` (_array of SentimentResponse_, required) One entry per input text, in order.

### TopicClassificationRequest

A topic classification request.

*   `texts` (_array of string_, required) Texts to classify (min 1). `responses[i]` maps to `texts[i]`.  
    Minimum items: 1.
*   `topicLabels` (_array of string_, required) Candidate topic labels to score each text against (min 1, max 100).  
    Minimum items: 1. Maximum items: 100.

### TopicClassificationResponse

A topic classification response.

*   `responses` (_array of TopicResponseResult_, required) One entry per input text, in order.

### ForecastRequest

A forecast request.

*   `trainColumns` (_array of ForecastColumn_, required) Historical data: the time column plus endogenous (the series to forecast) and any exogenous (driver) columns.
*   `predictColumns` (_array of ForecastColumn_) Known future values of exogenous variables over the forecast horizon.
*   `startTimestamp` (_string_) ISO-8601 start of the training window (for example, `2024-01-31T00:00:00`). Timezone offsets are accepted and silently stripped.
*   `endTimestamp` (_string_) ISO-8601 end of the training window.
*   `frequency` (_string_, required) Series cadence. Values follow pandas period aliases.  
    Allowed values: `CALENDAR_DAY`, `WEEKLY`, `MONTHLY`, `QUARTERLY`, `YEARLY`, `HOURLY`, `MINUTELY`, `SECONDLY`, `MILLISECONDS`, `MICROSECONDS`, `NANOSECONDS`, `MONTH_START`, `MONTH_END`, `UNSPECIFIED`.
*   `numberOfForecasts` (_integer_) How many future points to produce.  
    Minimum: 1.
*   `confidenceInterval` (_number_) Confidence interval for the prediction bounds.  
    Minimum: 0. Maximum: 1.
*   `modelParams` (_object_) Free-form additional model parameters.

### ForecastResponse

A forecast response.

*   `columns` (_array of ForecastColumn_, required) The forecast output as columns: typically the future timestamps plus the forecasted values (and interval bounds), in the same `ForecastColumn` shape.

### ChatMessageRequest

A message in a conversation. This message is used in a chat generation request.

*   `role` (_string_, required) Persona that sent the message.  
    Allowed values: `user`, `assistant`, `system`.
*   `content` (_string_, required) The content of the message.  
    Example: `Can you give me a recipe for cherry pie?`.

### Localization

Localization information, which can include the default locale, input locale(s), and expected output locale(s).

*   `defaultLocale` (_Locale_, required)
*   `inputLocales` (_array of ProbableLocale_) The list of language codes or locales found in the prompt’s text.
*   `expectedLocales` (_array of Locale_) Expected output languages of the generations. Derived from the output language instructions of the prompt.

### Tags

Entries used by the Models API for non-generative purposes and entries used by the client for free-form data.

### ResponseId

Identifier for a response.

Type: `string`.

Example: `014DFFD2-04B5-4765-8EA7-507585268CD3`.

### GenerationDetails

Details for a chat generation response.

*   `generations` (_array of ChatMessage_, required) Generated responses from the LLM.
*   `parameters` (_object_) Any provider-specific attributes included as part of this object.
    
    _Example_
    
    ```
    {
      "model": "gpt-3.5-turbo",
      "object": "text_completion",
      "usage": {
        "completion_tokens": 235,
        "prompt_tokens": 91,
        "total_tokens": 326
      }
    }
    ```
    

### Embeddings

An embedding vector for the text.

*   `embedding` (_array of number_) Embedding of the text. Data is specified as an array of numbers.
*   `index` (_integer_) Index of the input text to which the embedding belongs.

### GenerationRepresentation

The generated text that is part of the generation response.

*   `id` (_string_) Generation ID. This value is required to register feedback.  
    Example: `4399c4ea-89d4-44ca-ae8d-cf5926b41bc4`.
*   `generatedText` (_string_) The generated text.  
    Example: `The generated text.`.
*   `contentQuality` (_ContentTrustRepresentation_)
*   `parameters` (_object_, nullable) Any provider-specific attributes included as part of this object. Can be `null`.
    
    _Example_
    
    ```
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null
    }
    ```
    

### Column

One column of column-major (not row-major) input. Each entry has a `columnName` plus exactly one typed values array. Columns are parallel arrays: index `i` across every column forms record `i`.

*   `columnName` (_string_, required) The model feature name.  
    Example: `pclass`.
*   `stringValues` (_array of string_) String values for this column. Specify exactly one typed values array per column.
*   `doubleValues` (_array of number (double)_) Double values for this column. Specify exactly one typed values array per column.
*   `booleanValues` (_array of boolean_) Boolean values for this column. Specify exactly one typed values array per column.
*   `dateValues` (_array of string_) Date values for this column, as ISO-8601 strings. Specify exactly one typed values array per column.
*   `datetimeValues` (_array of string_) Datetime values for this column, as ISO-8601 strings. Specify exactly one typed values array per column.

### RegressionResult

One entry per record: either a success (with prediction) or a failure.

One of: `RegressionPredictionSuccess`, `PredictionFailure`.

### ClassificationResult

Result for a single record that contains either a prediction or a failure.

One of: `ClassificationPredictionSuccess`, `PredictionFailure`.

### MultiOutcomeResult

One entry per record: either a success (with a multiclass prediction) or a failure.

One of: `MultiOutcomePredictionSuccess`, `PredictionFailure`.

### SentimentResponse

A sentiment result for one text.

*   `label` (_string_, required) The sentiment label.  
    Allowed values: `Negative`, `Neutral`, `Positive`, `Unknown`, `Mixed`. Example: `Positive`.
*   `score` (_number (double)_) Confidence between -1.0 (negative) and 1.0 (positive).  
    Minimum: -1. Maximum: 1. Example: `0.94`.

### TopicResponseResult

Topic scores for one text.

*   `topicScores` (_array of TopicScore_) Score of the text against each topic label.

### ForecastColumn

A column used in forecast train columns, predict columns, and the response.

*   `columnName` (_string_, required) Column name.  
    Example: `ds`.
*   `columnType` (_string_, required) The role of the column in the time series.  
    Allowed values: `TIMESTAMP`, `EXOGENOUS`, `ENDOGENOUS`, `UNSPECIFIED`.
*   `values` (_ForecastValues_, required)
*   `inferenceMapping` (_string_) Only needed for pretrained models.
*   `nullIndexes` (_array of integer_) Indexes of null values (for models that tolerate gaps; Holt-Winters cannot).

### Locale

Language and region code.

Type: `string`.

Example: `en_US`.

### ProbableLocale

The locale and an optional probability value.

*   `locale` (_Locale_, required)
*   `probability` (_number_) An estimate of how frequently you expect this language or locale to appear in the input.  
    Minimum: 0. Maximum: 1. Example: `0.8`.

### ChatMessage

A message in a conversation. This message is used in a chat generation response.

*   `id` (_string_) Generation ID. This value is required to register feedback.
*   `role` (_string_, required) Persona that sent the message.  
    Allowed values: `user`, `assistant`, `system`.
*   `content` (_string_, required) The content of the message.  
    Example: `Can you give me a recipe for cherry pie?`.
*   `timestamp` (_integer (int64)_) Timestamp when the message was sent.  
    Example: `1682536893`.
*   `parameters` (_object_, nullable) Any provider-specific attributes included as part of this object.
    
    _Example_
    
    ```
    {
      "finish_reason": "stop",
      "index": 0,
      "logprobs": null
    }
    ```
    
*   `contentQuality` (_ContentTrustRepresentation_)

### ContentTrustRepresentation

Content moderation details for generated content, including its safety and quality scores.

*   `scanToxicity` (_TrustScannerRepresentation_)

### RegressionPredictionSuccess

*   `type` (_string_)  
    Allowed values: `RegressionPredictionSuccess`.
*   `prediction` (_RegressionPrediction_)

### PredictionFailure

A per-record failure. Other records in the batch still succeed.

*   `type` (_string_)  
    Allowed values: `PredictionFailure`.
*   `error` (_object_)
    *   `message` (_string_)
    *   `predictionErrorCode` (_string_)  
        Allowed values: `PREDICTION_ERROR_CODE_ERROR`, `PREDICTION_ERROR_CODE_TIMED_OUT`, `PREDICTION_ERROR_CODE_NO_MATCH`.

### ClassificationPredictionSuccess

Successful classification result containing the prediction.

*   `type` (_string_)  
    Allowed values: `ClassificationPredictionSuccess`.
*   `prediction` (_ClassificationPrediction_)

### MultiOutcomePredictionSuccess

*   `type` (_string_)  
    Allowed values: `MultiOutcomePredictionSuccess`.
*   `prediction` (_MultiOutcomePrediction_)

### TopicScore

The score of a text against a single topic label.

*   `label` (_string_, required) The topic label.  
    Example: `Billing`.
*   `score` (_number (double)_) Probability/association score for this label.  
    Example: `0.91`.
*   `relation` (_string_) Natural-language-inference relation.  
    Allowed values: `Entailment`, `Neutral`, `Contradiction`. Example: `Entailment`.

### ForecastValues

A typed list of values, discriminated by `valueType`.

*   `valueType` (_string_, required) The type of the values in this column. Timestamps are ISO-8601 strings.  
    Allowed values: `STRING`, `DOUBLE`, `INT`, `BOOL`, `TIMESTAMP`.
*   `values` (_array of any_, required) The list of values, of the type given by `valueType`.

### TrustScannerRepresentation

Represents safety and toxicity data.

*   `isDetected` (_boolean_) Indicates whether a scan detected any toxic content. A false value doesn’t necessarily mean that the content isn’t toxic.
*   `categories` (_array of TrustCategoryDetail_) A list of categories that were scanned for toxic content.

### RegressionPrediction

A regression prediction.

*   `predictedValue` (_number (double)_, required) The predicted numeric value.  
    Example: `42.5`.
*   `topContributors` (_array of ContributingFactor_) Factors driving the prediction.
*   `prescriptions` (_array of ContributingFactor_) Suggested changes to improve the outcome.
*   `warnings` (_PredictionWarnings_)

### ClassificationPrediction

A classification prediction.

*   `classProbabilities` (_array of ClassProbability_, required) Probability for each class, sorted in descending order.
*   `topContributors` (_array of ContributingFactor_) Factors that contributed to this prediction.
*   `warnings` (_PredictionWarnings_)

### MultiOutcomePrediction

A multi-outcome prediction.

*   `predictedValue` (_array of object_, required) A prediction that contains a probability for each of three or more classes. Each element is a free-form outcome object as produced by the model; its exact keys depend on the model. Iterate the array rather than assuming a fixed schema.
    
    _Example_
    
    ```
    [
      {
        "outcome": "will_renew",
        "probability": 0.73
      },
      {
        "outcome": "will_upsell",
        "probability": 0.21
      }
    ]
    ```
    
*   `type` (_string_) Optional prediction type (used by the validate endpoint).

### TrustCategoryDetail

Toxicity score for a given category.

*   `categoryName` (_string_) Name of the category.  
    Example: `profanity`.
*   `score` (_Score_)

### ContributingFactor

A factor driving a prediction, or a suggested change to improve the outcome.

*   `value` (_number (double)_) The contribution or prescription impact.  
    Example: `0.31`.
*   `conditions` (_array of PredictionCondition_)

### PredictionWarnings

Non-fatal warnings about the prediction input.

*   `outOfBoundsFields` (_array of string_)
*   `missingFields` (_array of string_)
*   `mismatchedFields` (_array of string_)

### ClassProbability

A predicted class with its probability.

*   `className` (_string_)  
    Example: `Login Issue`.
*   `probability` (_number (double)_)  
    Minimum: 0. Maximum: 1. Example: `0.82`.

### Score

A toxicity score value. A higher score means the response is more likely to be toxic.

Type: `number (float)`.

Default: `0`. Minimum: 0. Maximum: 1. Example: `0`.

### PredictionCondition

A field-value condition that describes a contributing factor or prescription.

*   `field` (_string_)  
    Example: `pclass`.
*   `value` (_string_)  
    Example: `3`.