Use cURL to integrate Vertex AI with Helicone to log your Vertex AI usage.
Create an account + Generate an API Key
Set API keys as environment variables
export HELICONE_API_KEY=<your API key> export GCLOUD_API_KEY=<your Google Cloud API key>
Send a request using CURL
curl --request POST \ --url "https://gateway.helicone.ai/v1/projects/$PROJECT_ID/locations/$LOCATION/publishers/google/models/$MODEL_NAME:streamGenerateContent" \ --header "Authorization: Bearer $GCLOUD_API_KEY" \ --header "Content-Type: application/json" \ --header "Helicone-Auth: Bearer $HELICONE_API_KEY" \ --header "Helicone-Target-URL: https://$LOCATION-aiplatform.googleapis.com" \ --header "User-Agent: curl/7.64.1" \ --data '{ "contents": { "role": "user", "parts": { "text": "Which theaters in Mountain View show Barbie movie?" } }, "generation_config": { "maxOutputTokens": 1 } }'
Was this page helpful?