Skip to main content
A wrapped key only works against the CostHawk proxy. Do not send ch_sk_... directly to Google’s native endpoint.
If you are not sure whether you have a wrapped key or a CostHawk access token, read Wrapped Keys first.

Quick Setup

1

Create a wrapped key

Go to Dashboard → Integrations, click Create API Key, select Google, and paste your Google AI API key.
2

Copy your wrapped key

Copy the ch_sk_... key that CostHawk generates.
3

Update your code

Change the base URL and API key as shown below.

Proxy URL

This replaces https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent.

Code Examples

Python

Node.js

curl

Include the model field in the request body. CostHawk uses it to construct the correct Google API URL (/v1beta/models/{model}:generateContent).

Supported Models

All Google Gemini models work through the proxy, including:
  • gemini-2.0-flash
  • gemini-2.0-pro
  • gemini-1.5-flash
  • gemini-1.5-pro

Supported Endpoint

The proxy supports the generateContent endpoint. Pass the model name in the request body and CostHawk handles the URL routing.