TokenFlow - AI API Gateway & Cost Optimizer

Description
### Cut Your AI API Costs by 40-70%
TokenFlow is a self-hosted reverse proxy that sits between your applications and AI providers, automatically optimizing token costs through **semantic caching, smart model routing, and prompt compression**.
### The Problem AI API costs are spiraling out of control. Companies spend thousands monthly on OpenAI, Anthropic, and other providers — often paying full price for duplicate or similar requests.
### The Solution TokenFlow acts as an intelligent middleware. Change one URL in your code, and every request is automatically: - **Cached semantically** — similar prompts return cached responses (FREE) - **Compressed** — redundant tokens removed before sending - **Routed optimally** — simple tasks sent to cheaper models automatically - **Tracked** — full cost analytics with budget alerts
Features
**8 AI Provider Support** OpenAI, Anthropic Claude, Google Gemini, Mistral, DeepSeek, Groq, Cohere, and Ollama (local models).
**OpenAI-Compatible API** Drop-in replacement. Just change your `base_url` — existing code works unchanged with Python, JavaScript, cURL, PHP, LangChain, Vercel AI SDK.
**Semantic Caching** Not just exact matches — finds similar prompts using cosine similarity. Configurable threshold and TTL.
**Smart Model Routing** Define rules: "If prompt < 500 tokens, use gpt-4o-mini" or "If prompt contains 'code', use deepseek-coder."
**Prompt Compression** Automatically removes redundant whitespace, deduplicates content, and summarizes long conversation histories.
**Budget Protection** Set daily/weekly/monthly spending limits with automatic model downgrade when exceeded.
**Real-Time Analytics Dashboard** Live request feed, cost charts, savings breakdown, provider distribution, latency tracking.
**API Playground** Test requests through the proxy and see caching, routing, and compression in action.
**Admin Panel** User management, API key management, model configuration, system settings.
Requirements
- Node.js 18 or higher - npm or yarn - No database server needed (SQLite included) - Optional: PostgreSQL for production - Optional: AI provider API keys (OpenAI, Anthropic, etc.)
Instructions
npm install npx prisma db push npx tsx prisma/seed.ts npm run dev ``` Open http://localhost:3000 — gateway is running! Change your AI SDK base_url to http://localhost:3000/api/v1
| Author | eneseserkan |
|---|---|
| Category | Scripts & Code / NodeJS |
| Price | $44 |
| Extended License | $132 |
| Likes | 2 |
| First Release | Mar 24, 2026 |
| Last Update | Mar 24, 2026 |
| Files included | .css, .html, JavaScript .js |
Categories
Tags
External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.
Products of the Week.
Submit🥇
Perceptle
Perceptle is a daily browser-based game that challenges you to test your sensory intuition through five quick estimation and rhythm-based rounds.
Other · 3,957 views · 16 clicksOther · Week 47 · 3,957 views · 16 clicks
🥈
Free LinkedIn Likes From Real
Get free LinkedIn likes on your posts from real members who react by hand. No
SaaS · 4,075 views · 18 clicksSaaS · Week 47 · 4,075 views · 18 clicks
🥉
STOP GUESSING WHAT TO POST
AI that learns your brand voice and builds a month of consistent, on-brand social content: carousels, posts and hooks that sound like you, not like everyone else's AI.
SaaS · 11,557 views · 80 clicksSaaS · Week 47 · 11,557 views · 80 clicks
#4
aaas.market
407 reliable micro tools for solo founders, marketers and creators. They work in your browser
SaaS · 3,936 views · 7 clicksSaaS · Week 47 · 3,936 views · 7 clicks