gcloud ai endpoints raw-predict (ENDPOINT : --region=REGION) --request=REQUEST [--http-headers=[HEADER=VALUE,…]] [GCLOUD_WIDE_FLAG …]
gcloud ai endpoints raw-predict sends a raw prediction request to a
Vertex AI endpoint. The request can be given on the command line or read from a
file or stdin.
123 under
project example in region
us-central1, reading the request from the
command line, run:
gcloud ai endpoints raw-predict 123 --project=example --region=us-central1 --request='{
"instances": [
{ "values": [1, 2, 3, 4], "key": 1 },
{ "values": [5, 6, 7, 8], "key": 2 }
]
}'
If the request body was in the file
, run:
input.json
gcloud ai endpoints raw-predict 123 --project=example --region=us-central1 --request=@input.json
To send the image file and set
the image.jpegcontent type, run:
gcloud ai endpoints raw-predict 123 --project=example --region=us-central1 --http-headers=Content-Type=image/jpeg --request=@image.jpeg
To set the project attribute:
endpoint on the command line with a fully
specified name;
--project on the command line;
core/project.
ENDPOINT
To set the name attribute:
endpoint on the command line.
--region=REGIONregion attribute:
endpoint on the command line with a fully
specified name;
--region on the command line;
ai/region;
--request=REQUEST
If the request starts with the letter '@', the rest should be a
file name to read the request from, or '@-' to read from
stdin. If the request body actually starts with '@',
it must be placed in a file.
Content-Type header should also be set
appropriately, particularly for binary data.
--http-headers=[HEADER=VALUE,…]Content-Type and X-Header:
--http-headers=Content-Type="application/json",X-Header=Value
--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha ai endpoints raw-predictgcloud beta ai endpoints raw-predict
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.