Case study
One router for Gemini and OpenAI, with fallback and cost metering
All AI calls in GoGinnie go through one router that can switch between Google Gemini and OpenAI automatically and records token use and latency for each feature.


Context
Where this started.
Context
GoGinnie uses language models in several features: recommendations, the assistant, the trip planner and the feed.
Problem
Depending on one AI provider makes an app fragile, and without measurement nobody knows which feature is spending the money.
Approach
What was done.
Features
- Recommendations
- Ask Ginnie
- Trip planner
- Feed titles
Router
- call_ai: One entry point
Providers
- OpenAI: Default provider
- Google Gemini: Or by preference
Records
- Usage records: Kept 90 days
Connections
- Recommendations → call_ai: Prompt and feature name
- Ask Ginnie → call_ai: Prompt and feature name
- Trip planner → call_ai: Prompt and feature name
- Feed titles → call_ai: Prompt and feature name
- call_ai → OpenAI: Preferred, or retry after Gemini fails
- call_ai → Google Gemini: Preferred, or retry after OpenAI fails
- OpenAI → Usage records: Tokens and latency
- Google Gemini → Usage records: Tokens and latency
- 01
A single entry point
Features call one function, not a provider. It uses the user’s preferred provider: OpenAI by default, or Google Gemini.
- 02
Automatic fallback
If the preferred provider’s request fails, it retries once with the other provider. The user’s preference is never changed.
- 03
Metering per feature
Every successful call records the feature, provider, model, tokens and latency, kept for 90 days, so cost and speed can be tracked and tuned.
Outcome
The result, in plain terms.
In production in the live web app. Cost figures are not published.
- providers behind one router
- 2
For you
What a similar client would get.
- One place in your code through which every AI call goes.
- A second provider ready, so one provider failing does not stop your product.
- AI cost and speed measured per feature, from the first release.
Technology
What it was built with.
Facing a similar problem?
Tell us what you are working on. A person from Dessot will reply.

