Pharox sits between your code and AI providers. It automatically compresses prompts and routes each request to the cheapest model that can handle it — saving up to 80% with one line of code.
# Before — paying $2.50 per 1M tokens from openai import OpenAI client = OpenAI(api_key="sk-...") # After — one line change, up to 80% cheaper from pharox import Pharox client = Pharox(api_key="pharox-...") # Everything else stays exactly the same response = client.chat.completions.create( model="gpt-4", # Pharox picks the model messages=[{"role": "user", "content": "Hello!"}] )
Three steps happen automatically on every request. Your code doesn't change — just the bill.
Pharox automatically shortens your prompts before sending them to the AI, reducing token usage while preserving meaning.
A local embedding model classifies each prompt as simple or complex in milliseconds — no extra API call, no added cost.
Simple prompts go to ultra-cheap models like Gemini Flash or Llama 8B. Complex reasoning goes to the premium model. You choose the pool.
Built for developers who want results, not configuration.
Semantic similarity matching routes each prompt to the cheapest model capable of handling it. No rules to write, no thresholds to tune.
Every prompt is rewritten to remove filler while preserving meaning. Code blocks are always preserved verbatim.
Replace your OpenAI, Gemini, and Groq keys with one Pharox key. We handle provider authentication, rate limits, and fallbacks.
Your dashboard shows every request: which model it was routed to, how many tokens, exact cost, and savings vs baseline.
Choose which models Pharox routes between. Enable or disable any model with a toggle. Use force="pro" to override routing.
If one provider hits a rate limit, Pharox automatically retries with the next available model. Zero downtime from quota exhaustion.
Works with the OpenAI SDK, LangChain, and any OpenAI-compatible library.
from openai import OpenAI client = OpenAI( api_key="sk-proj-..." ) response = client.chat.completions.create( model="gpt-4", messages=[...] ) # Cost: $2.50 / 1M tokens # No compression, no routing # No fallbacks
from pharox import Pharox client = Pharox( api_key="pharox-..." ) response = client.chat.completions.create( model="auto", # Pharox routes optimally messages=[...] ) # Cost: ~$0.10–0.59 / 1M tokens # Auto-compressed + smart routing # Automatic fallbacks
LangChain support
from langchain_openai import ChatOpenAI llm = ChatOpenAI( openai_api_key="pharox-...", openai_api_base="https://pharox-ai.com/v1", )
You pay Pharox a flat fee. We handle all provider costs. The savings far outweigh the subscription.
Join developers already cutting their AI API costs by up to 80%.
Free to start. No credit card required.