Proxy Integration

1

Create an account + Generate an API Key

Log into helicone or create an account. Once you have an account, you can generate an API key.

2

Set API keys as environment variables

export HELICONE_API_KEY=<your API key>
export GCLOUD_API_KEY=<your Google Cloud API key>
3

Send a request using CURL

Use the following CURL command to send a request to the Vertex AI API through the Helicone proxy:

curl --request POST \
  --url https://gateway.helicone.ai/v1/projects/your-project-id/locations/your-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
  }
}'