I'm using the example curl I get from:
but I get a 404 everytime. I have the right Bearer auth token. Everything seems to be correct but 404!
The built URL apparently is incorrect.
text-bison
(without the @001
)https://${API_ENDPOINT}/v1/projects/${PROJECT_ID}/locations/us-central1/publishers/google/models/${MODEL_ID}:predict
(/models
was missing)All in all:
API_ENDPOINT="us-central1-aiplatform.googleapis.com"
PROJECT_ID="<projectID>"
MODEL_ID="text-bison"
curl \
-X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://${API_ENDPOINT}/v1/projects/${PROJECT_ID}/locations/us-central1/publishers/google/models/${MODEL_ID}:predict" -d \
$'{
"instances": [
{
"content": "Write a short poem:"
}
],
"parameters": {
"temperature": 0.2,
"maxOutputTokens": 256,
"topP": 0.8,
"topK": 40
}
}'
Source: https://cloud.google.com/vertex-ai/docs/generative-ai/start/quickstarts/api-quickstart