---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/endpoints/{endpointsId}:directPredict"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/endpoints/{endpointsId}:directPredict"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/endpoints/{endpointsId}:directPredict

`POST /v1/projects/{projectsId}/locations/{locationsId}/endpoints/{endpointsId}:directPredict`

## Request

- Base URL: `https://aiplatform.googleapis.com`
- URL: `https://aiplatform.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/endpoints/{endpointsId}:directPredict`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/aiplatform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/aiplatform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform.read-only`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform.read-only`

Perform an unary online prediction request to a gRPC model server for Vertex first-party products and frameworks.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `endpointsId` string, required

## Request body

- GoogleCloudAiplatformV1DirectPredictRequest: Request message for PredictionService.DirectPredict.
  - `inputs` GoogleCloudAiplatformV1Tensor[]: The prediction input.
    - `boolVal` boolean[]: Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
    - `bytesVal` string[]: STRING
    - `doubleVal` number[]: DOUBLE
    - `dtype` 'DATA_TYPE_UNSPECIFIED' | 'BOOL' | 'STRING' | 'FLOAT' | 'DOUBLE' | 'INT8' | 'INT16' | 'INT32' | 'INT64' | 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64': The data type of tensor.
    - `floatVal` number[]: FLOAT
    - `int64Val` string[]: INT64
    - `intVal` integer[]: INT_8 INT_16 INT_32
    - `listVal` GoogleCloudAiplatformV1Tensor[]: A list of tensor values.
    - `shape` string[]: Shape of the tensor.
    - `stringVal` string[]: STRING
    - `structVal` object: A map of string to tensor.
    - `tensorVal` string, byte: Serialized raw tensor content.
    - `uint64Val` string[]: UINT64
    - `uintVal` integer[]: UINT8 UINT16 UINT32
  - `parameters` GoogleCloudAiplatformV1Tensor: A tensor value type.
    - `boolVal` boolean[]: Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
    - `bytesVal` string[]: STRING
    - `doubleVal` number[]: DOUBLE
    - `dtype` 'DATA_TYPE_UNSPECIFIED' | 'BOOL' | 'STRING' | 'FLOAT' | 'DOUBLE' | 'INT8' | 'INT16' | 'INT32' | 'INT64' | 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64': The data type of tensor.
    - `floatVal` number[]: FLOAT
    - `int64Val` string[]: INT64
    - `intVal` integer[]: INT_8 INT_16 INT_32
    - `listVal` GoogleCloudAiplatformV1Tensor[]: A list of tensor values.
    - `shape` string[]: Shape of the tensor.
    - `stringVal` string[]: STRING
    - `structVal` object: A map of string to tensor.
    - `tensorVal` string, byte: Serialized raw tensor content.
    - `uint64Val` string[]: UINT64
    - `uintVal` integer[]: UINT8 UINT16 UINT32

## Response `200`

Successful response

- GoogleCloudAiplatformV1DirectPredictResponse: Response message for PredictionService.DirectPredict.
  - `outputs` GoogleCloudAiplatformV1Tensor[]: The prediction output.
    - `boolVal` boolean[]: Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
    - `bytesVal` string[]: STRING
    - `doubleVal` number[]: DOUBLE
    - `dtype` 'DATA_TYPE_UNSPECIFIED' | 'BOOL' | 'STRING' | 'FLOAT' | 'DOUBLE' | 'INT8' | 'INT16' | 'INT32' | 'INT64' | 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64': The data type of tensor.
    - `floatVal` number[]: FLOAT
    - `int64Val` string[]: INT64
    - `intVal` integer[]: INT_8 INT_16 INT_32
    - `listVal` GoogleCloudAiplatformV1Tensor[]: A list of tensor values.
    - `shape` string[]: Shape of the tensor.
    - `stringVal` string[]: STRING
    - `structVal` object: A map of string to tensor.
    - `tensorVal` string, byte: Serialized raw tensor content.
    - `uint64Val` string[]: UINT64
    - `uintVal` integer[]: UINT8 UINT16 UINT32
  - `parameters` GoogleCloudAiplatformV1Tensor: A tensor value type.
    - `boolVal` boolean[]: Type specific representations that make it easy to create tensor protos in all languages. Only the representation corresponding to "dtype" can be set. The values hold the flattened representation of the tensor in row major order. BOOL
    - `bytesVal` string[]: STRING
    - `doubleVal` number[]: DOUBLE
    - `dtype` 'DATA_TYPE_UNSPECIFIED' | 'BOOL' | 'STRING' | 'FLOAT' | 'DOUBLE' | 'INT8' | 'INT16' | 'INT32' | 'INT64' | 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64': The data type of tensor.
    - `floatVal` number[]: FLOAT
    - `int64Val` string[]: INT64
    - `intVal` integer[]: INT_8 INT_16 INT_32
    - `listVal` GoogleCloudAiplatformV1Tensor[]: A list of tensor values.
    - `shape` string[]: Shape of the tensor.
    - `stringVal` string[]: STRING
    - `structVal` object: A map of string to tensor.
    - `tensorVal` string, byte: Serialized raw tensor content.
    - `uint64Val` string[]: UINT64
    - `uintVal` integer[]: UINT8 UINT16 UINT32

## Changes

- **2026-11-06** `3aca3b348f0c`: 4 info
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2c`
- **2026-10-30** `34fcc627b062`: 4 info
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/aiplatform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/aiplatform/changes/v1/projects/:projectsId/locations/:locationsId/endpoints/:endpointsId:directPredict/post.md)

---

[API](https://skmtc.dev/google/apis/aiplatform.md) - [All operations](https://skmtc.dev/google/apis/aiplatform/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/aiplatform/revisions/3aca3b348f0c?raw)
