Live data from Hacker News

API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

tokensaver.org

1–10 of 41 posts

Re: API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

#2
Out of frustration, I built an AI API proxy that automatically routes each request to the cheapest available provider in real-time.

The problem: AI API pricing is a mess. OpenAI, Anthropic, and Google all have different pricing models, rate limits, and availability. Switching providers means rewriting code. Most devs just pick one and overpay.

The solution: One endpoint. Drop-in replacement for OpenAI's API. Behind the scenes, it checks current pricing and routes to whichever provider (GPT-4o, Claude, Gemini) costs least for that specific request. If one fails, it falls back to the next cheapest.

How it works: - Estimates token count before routing - Queries real-time provider costs from database - Routes to cheapest available option - Automatic fallback on provider errors - Unified response format regardless of provider

Typical savings: 60-90% on most requests, since Gemini Flash is often free/cheapest, but you still get Claude or GPT-4 when needed.

30 free requests, no card required: https://tokensaver.org

Technical deep-dive on provider pricing: https://tokensaver.org/blog/openai-vs-anthropic-vs-gemini-pr...

I wrote up how to reduce AI costs without switching providers entirely: https://tokensaver.org/blog/reduce-ai-api-costs-without-swit...

Happy to answer questions about the routing logic, pricing model, or architecture.

Re: API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

#5
post #3

input tokens: $0.5 per 1,000 output tokens: $1.5 per 1,000 that's either one hell of a typo or my god I'll be broke in an hour if I accidentally use this service

Yeah, agreed. This sounds like a proper scam to me...

Re: API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

#6
post #2

Out of frustration, I built an AI API proxy that automatically routes each request to the cheapest available provider in real-time. The problem: AI API pricing is a mess. OpenAI, Anthropic, and Google all have different pricing models, rate limits, and availability. Switching providers means rewriting code. Most devs just pick one and overpay. The solution: One endpoint. Drop-in replacement for OpenAI's API. Behind t…

> Typical savings: 60-90% on most requests, since Gemini Flash is often free/cheapest, but you still get Claude or GPT-4 when needed.

This claim seems overstated. Accurately routing arbitrary prompts to the cheapest viable model is a hard problem. If it were reliably solvable, it would fundamentally disrupt the pricing models of OpenAI and Anthropic. In practice, you'd either sacrifice quality on edge cases or end up re-running failed requests on pricier models anyway, eating into those "savings".

Re: API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

#7
post #2

Out of frustration, I built an AI API proxy that automatically routes each request to the cheapest available provider in real-time. The problem: AI API pricing is a mess. OpenAI, Anthropic, and Google all have different pricing models, rate limits, and availability. Switching providers means rewriting code. Most devs just pick one and overpay. The solution: One endpoint. Drop-in replacement for OpenAI's API. Behind t…

Hi, curious, did you know about OpenRouter before building this?

> OpenRouter provides a unified API that gives you access to hundreds of AI models through a single endpoint, while automatically handling fallbacks and selecting the most cost-effective options. Get started with just a few lines of code using your preferred SDK or framework.

It isn't OpenAI API compatible as far as I know, but they have been providing this service for a while...

Re: API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

#8
This landing page is vibe coded and littered with mistakes/typos (per 1,000 tokens), outdated models (Gemini 1.5?), the security link at the bottom of the page is an href=#, and I can see the "dashboard" without logging in or signing up.

> Message Privacy: Your API requests are processed and immediately forwarded. We never store or log conversation content.

> Minimal Data: We only store your email and usage records. Nothing else. Your data stays yours.

Source: trust me bro.

Re: API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

#9
post #6
post #2

Out of frustration, I built an AI API proxy that automatically routes each request to the cheapest available provider in real-time. The problem: AI API pricing is a mess. OpenAI, Anthropic, and Google all have different pricing models, rate limits, and availability. Switching providers means rewriting code. Most devs just pick one and overpay. The solution: One endpoint. Drop-in replacement for OpenAI's API. Behind t…

> Typical savings: 60-90% on most requests, since Gemini Flash is often free/cheapest, but you still get Claude or GPT-4 when needed. This claim seems overstated. Accurately routing arbitrary prompts to the cheapest viable model is a hard problem. If it were reliably solvable, it would fundamentally disrupt the pricing models of OpenAI and Anthropic. In practice, you'd either sacrifice quality on edge cases or end up…

I genuinely wonder the use cases are where the required accuracy is so low (or I guess the prompts are so strong) that you don't need to vigorously use evals to prevent regressions with the model that works best--let alone actually just change models on the fly based on what's cheaper.

Re: API that auto-routes to the cheapest AI provider (OpenAI/Anthropic/Gemini)

#10
post #7
post #2

Out of frustration, I built an AI API proxy that automatically routes each request to the cheapest available provider in real-time. The problem: AI API pricing is a mess. OpenAI, Anthropic, and Google all have different pricing models, rate limits, and availability. Switching providers means rewriting code. Most devs just pick one and overpay. The solution: One endpoint. Drop-in replacement for OpenAI's API. Behind t…

Hi, curious, did you know about OpenRouter before building this? > OpenRouter provides a unified API that gives you access to hundreds of AI models through a single endpoint, while automatically handling fallbacks and selecting the most cost-effective options. Get started with just a few lines of code using your preferred SDK or framework. It isn't OpenAI API compatible as far as I know, but they have been providing…

OpenRouter can also prioritize providers by price: https://openrouter.ai/docs/guides/routing/provider-selection...
Post reply on HN