Case Study

OpenAI, Claude & Gemini Integration

AI Services

If OpenAI Goes Down, the Chat Window Shouldn’t Notice

Wiring a product to call GPT-4o is an afternoon’s work. Making that call survive a slow provider day, an expensive week, or the hour someone needs an exact cost number is the actual job, handled without the product knowing or caring which model answered.

SupportGenie was built for a SaaS support team running customer chat on OpenAI. It’s the backend layer between the support product and whichever model is answering: OpenAI by default, Claude the moment OpenAI looks degraded. It streams every response and keeps the conversation’s memory intact through the switch, across 24,532 conversations this week.

Single Image
Services
OpenAI, Claude & Gemini Integration, LLM Gateway
Scope
SaaS / Customer Support
Engagement
OpenAI GPT-4o, Anthropic Claude integration
Design system
LLM routing, token usage, cost tracking and fallback reliability
Problem yellow bulb icon
Problem

A support integration wired to a single provider is one outage or one price change away from being offline or over budget, and switching providers manually mid-incident means losing conversation context exactly when things are already going wrong.

Solution green bulb icon
Solution

A provider-agnostic gateway streams every response in real time, detects when the primary is degraded, and fails over automatically without dropping context, logging cost per provider so nobody finds out about a price spike from the invoice.

Single Image
The Project

A Gateway, Not a Dependency

Every request goes through a gateway that picks a provider based on live health and cost, not a choice hard-coded at launch. The part that’s easy to get wrong is the failover itself: if a conversation three messages deep suddenly routes to a different model, the customer should never be able to tell. SupportGenie carries context across the switch, so a customer asking about order #12345 gets a coherent reply whether message four came from GPT-4o or Claude. Every exchange is logged with its token count and provider, keeping a $0.042-per-1K-token blended cost a known number.

Interface Architecture

How SupportGenie Is Put Together

Four components sit between the chat window and the model providers. The product only ever talks to the gateway, so routing, failover and cost tracking can change underneath it without touching the support experience.

Request gateway

Receives every chat request and holds the conversation’s context across the session, regardless of which model answers.

Provider router

Picks OpenAI or Claude per request based on live latency, health, and cost signals

Failover

Detects a degraded primary mid-conversation and switches without the user noticing or losing history.

Cost logging

Tracks tokens and spend per conversation and per provider, feeding the number ops actually checks.

What We Build

What We Built Into the Platform

Mid-Conversation Failover

A provider switch can happen on message four of a conversation without the earlier messages being lost.

Streaming on Both Providers

Responses stream token by token the same way whether OpenAI or Claude is answering.

Per-Provider Cost Logging

Spend is tracked by provider, not just in aggregate, so a price change on one side shows up immediately.

Health-Based Routing

The router reacts to live latency and error rates rather than a fixed schedule or manual toggle.

Centralized Key Management

Provider credentials live in one place instead of being copied into every service that needs to call out.

99.42% fallback success

Measured over a 30-day window against real traffic, not a synthetic test.

What Changed
From a Single Provider to a Resilient Gateway

The aim was a support chat that keeps working whatever happens upstream. Here is how SupportGenie differs from a direct, single-provider integration.

How We Work

How we got there

1
Catalogued what actually breaks

Outages, rate limits, latency spikes and price changes: the specific failure modes that had already hit similar integrations.

2
Built the gateway first

Started with the request and response layer both providers would sit behind, before writing any routing logic.

3
Added routing, then failover

Health-based provider selection came first; failover without losing context came once routing was proven stable.

4
Instrumented cost from day one

Token and spend logging went in alongside the routing logic, not after someone asked for a cost report.

5
Forced real outages in staging

Killed the primary provider mid-conversation repeatedly until failover held up without manual intervention.

6
Wrote the on-call runbook

An automatic switch still needs someone to understand it at 2am, including what’s safe to ignore.

Software & Tools

The Tools Behind the Innovation

Ready to move from confusion to

 clarity?