Two Google surfaces, one policy
Google sells Gemini models through two front doors: the Gemini API with an API key, and Vertex AI inside a Google Cloud project with IAM credentials. PALM SOUQ supports both at gateway.palmsouqltd.com/gemini and gateway.palmsouqltd.com/vertex. Quotas, breakers and fallback chains are written once against the model name and apply whichever door the request uses.
With the google-genai SDK you set http_options with the gateway base URL and headers. For Vertex AI the gateway forwards your OAuth access token unchanged, so service account permissions and VPC Service Controls on the Google side keep working as they do today.
Metering context caching and thinking
Gemini reports usage in usageMetadata: promptTokenCount, candidatesTokenCount, cachedContentTokenCount and thoughtsTokenCount. PALM SOUQ prices cached content at the cached rate, prices thinking tokens as output (which is how Google bills them) and shows them as a separate line so a tenant whose prompts trigger long reasoning is visible before the month closes.
Several Gemini models charge a higher rate above a prompt length threshold. The gateway checks the prompt token count on each call and applies the correct band, so a tenant that pastes whole document sets into one prompt is priced at the long-context rate, not the headline rate in a pricing table.
Where Gemini fits in a fallback chain
Gemini 2.5 Flash and Flash-Lite are among the cheapest capable models in the PALM SOUQ price index, which makes them natural fallback targets. A common policy downgrades a tenant from Gemini 2.5 Pro to 2.5 Flash at 90% of monthly budget, and to Flash-Lite at 100% for read-only features, before returning a hard 429.
Explicit context caches on Gemini also carry a storage charge per hour. PALM SOUQ records cache creation calls with the tenant that created them, so storage cost is attributed to the customer whose document set is being kept warm.
Rolling it out safely
If you use both the Gemini API and Vertex AI, connect one surface first and keep the other direct for a few days. Compare the token counts PALM SOUQ records with the usage reported in Google AI Studio or Cloud Billing for the same window, paying particular attention to thinking tokens on 2.5 Pro and Flash, which are easy to miss in a summary view.
When both surfaces are routed, write your fallback chain once and check the audit log to confirm downgrades fire on the model you expect, whichever door the request came through.