Google Gemini

TokenSense supports Gemini text generation through native generateContent requests and translated Chat Completions. Current choices include Gemini 3.8 Flash, 3.1 Flash-Lite, and 3.1 Pro Preview. Model access and supported features depend on your Google AI Studio account.

Connect Gemini to TokenSense

Already have a TokenSense account? Here's how to start tracking Gemini costs:

Step 1: Go to your dashboard → Provider Keys → Add your Google AI API key (from Google AI Studio or your GCP project).

Step 2:In your workflow, point requests at your TokenSense endpoint using Gemini's native format. TokenSense identifies Gemini requests by the model name and routes them correctly.

Step 3: Authenticate with your TokenSense API key. Costs appear in your dashboard within seconds of each request.

Native Gemini support.TokenSense handles Google's Gemini API format directly. No need to translate requests through an OpenAI compatibility layer — token usage is taken from the provider response. Live, Interactions, video generation, and speech expansion are separate endpoints with separate support requirements.

Current text models

ModelStateNotes
gemini-3.8-flashStableLow, medium, and high thinking; minimal is unsupported
gemini-3.7-flashStableFlash text generation
gemini-3.5-flash-liteStableFlash-Lite text generation
gemini-3.1-flash-liteStableReplacement for the shut-down Flash-Lite preview
gemini-3.1-pro-previewPreviewVerify preview availability before adopting it

Google's current rates include temporary launch promotions and different input modalities, context tiers, cache storage, and service tiers. Consult Google's pricing page and your TokenSense catalog rather than treating a single token rate as the complete bill.

Gemini 3.8 request controls

For both native generateContent and translated Chat requests, TokenSense maps minimal thinking to low and removes deprecated temperature, topP, topK, candidateCount, and thinkingBudget controls for Gemini 3.8 Flash. Low, medium, and high are supported. The x-tokensense-adapted response header reports changes. Tool conversations retain Google function-call IDs and thought signatures; preserve these when returning tool results.

Lifecycle and replacement guidance

Google lists Gemini 2.5 Pro, Flash, and Flash-Lite as restricted to existing users. An earliest possible shutdown date is not a confirmed retirement. TokenSense retains their pricing history and does not retire them from that date alone.

Gemini 3.1 Flash-Lite Preview, Gemini 3 Pro Preview, Gemini 2.0 Flash and Flash-Lite, and Imagen 4 are confirmed shut down. Existing requests receive an actionable error; saved workflows are not silently rewritten. See Google's model catalog for current replacements.

Image generation

Current Gemini image models use native generateContent, a different request format from Imagen's predict endpoint. Updating the model name in an Imagen request does not make it compatible. TokenSense supports the current Gemini image models through /v1/images/generations or native generateContent. It preserves image bytes and prices image output separately from text and thinking when usage includes those dimensions. Missing billable usage is reported as unknown. The Images compatibility route currently supports one square 1K image; use native generateContent for other options. Imagen 4 is unavailable.

Using Gemini in your workflows

TokenSense works with any tool that can make HTTP requests:

n8n: The TokenSense n8n node supports Gemini models. Select a Gemini model in the node configuration.

Make / Zapier: Use an HTTP module pointed at your TokenSense endpoint. Send requests in Gemini's native format. See the Make & Zapier guide.

Custom code: Replace your Gemini API endpoint with your TokenSense endpoint. See the API reference.

Related