Dual-stage AI token optimization engine
Simultaneously compress input context payloads and eliminate expensive output generation multipliers with zero codebase modifications.
Blends 50-68% input context reduction with 30-50% output generation brevity.
Ultra-fast in-memory streaming gateway executing at the edge.
Drop-in baseURL configuration with zero prompt refactoring required.
The production engineering challenge
Modern AI applications suffer from asymmetric billing: input tokens carry massive context payload bloat from RAG docs and system instructions, while output tokens cost 300% to 500% more per million. Optimizing only input or only output leaves over half of potential savings on the table.
Technical architecture & mechanics
Stage 1: In-memory input context compression
Analyzes prompt AST and natural language payloads to eliminate token-heavy sub-words, repetitive delimiters, and conversational fluff while preserving code blocks bit-for-bit.
Stage 2: Output efficiency governor
Dynamically injects behavioral brevity directives into API calls that direct the target model to omit polite conversational preamble, repetitive confirmations, and markdown fluff.
End-to-end transparent reverse proxy
Operates as a high-speed gateway requiring only a single baseURL change in your OpenAI, Anthropic, or Vercel AI SDK client configurations.
Standard OpenAI SDK Drop-in
Architecture comparison
| Evaluation metric | Curtly.dev gateway | Traditional / naive approach |
|---|---|---|
| Input Context Compression | Automated 50-68% reduction with AST Safe Vault lock | Manual prompt shortening or static truncation |
| Output Token Governance | Automated 30-50% output reduction eliminating 5x multipliers | None (full price paid on verbose output generation) |
| Syntax Preservation | 100% bit-for-bit guarantee on code and JSON | High risk of JSON corruption and lost code delimiters |
| Integration Overhead | 1-line baseURL swap in standard SDKs | Complex custom middleware and prompt rewrites |
Frequently asked questions
Explore related platform features
Ready to optimize your AI infrastructure?
Start optimizing in 60 seconds with a 1-line baseURL change. Free tier available with zero credit card required.