Qual LLM escolher? (Replit trocou Anthropic)
Replit: saiu Anthropic (caro), entrou OpenAI (barato). Seu agent: qual provider? Custo vs. qualidade. Vendor lock-in risk.
Equipe OpenClaw · Time de Engenharia & Produto
A Equipe OpenClaw é formada por engenheiros, designers e especialistas em IA dedicados a construir a melhor plataforma de agentes conversacionais para negócios brasileiros. Combinamos expertise…
Qual LLM escolher? (Replit trocou Anthropic)
Cenário confuso (que todo founder enfrenta):
Você é founder de SaaS com agent (atendimento, vendas, automação).
Você escolheu: Claude (Anthropic).
Por quê?
- Melhor qualidade (mais confiável, menos hallucinations)
- Melhor segurança (constitution AI, safer)
- Melhor pra coding (agentic tasks)
- Melhor pra compliance (LGPD, regulação)
Realidade: Claude é CARO
Comparação de preços (out 2026):
OpenAI GPT-4: Input: R$ 0.0075 per 1000 tokens Output: R$ 0.030 per 1000 tokens
Anthropic Claude 3 Opus: Input: R$ 0.015 per 1000 tokens (2x more expensive) Output: R$ 0.075 per 1000 tokens (2.5x more expensive)
Your monthly cost: OpenAI: R$ 10k Claude: R$ 25k (150% more)
Then: Replit (major SaaS) drops Anthropic
Replit CEO (Amjad Masad):
"We're no longer working with Anthropic" "For a number of different reasons, including cost"
Translation:
"Claude is too expensive. We're switching to OpenAI."
Your reaction:
"Wait, if Replit (which has VC funding) says Claude is too expensive... is it too expensive for MY SaaS?"
Answer: probably yes.
The LLM provider dilemma (cost vs. quality)
The choice matrix
Providers (main options):
-
OpenAI (GPT-4, GPT-4o) Cost: LOW Quality: MEDIUM-HIGH Speed: FAST Agent capability: GOOD Market share: HUGE (dominant)
-
Anthropic (Claude 3, Claude 3.5) Cost: HIGH (2-3x more expensive) Quality: HIGH (best for coding, reasoning) Speed: MEDIUM Agent capability: EXCELLENT Market share: GROWING (but niche)
-
Google (Gemini) Cost: LOW Quality: MEDIUM Speed: VERY FAST Agent capability: GOOD Market share: GROWING
-
DeepSeek (Chinese, open weights) Cost: VERY LOW (cheapest) Quality: HIGH (surprisingly good) Speed: MEDIUM Agent capability: GOOD Market share: UNKNOWN (regulatory risk)
-
Meta (Llama, open source) Cost: VERY LOW (self-hosted) Quality: MEDIUM Speed: DEPENDS (on hardware) Agent capability: GOOD Market share: GROWING (developer favorite)
The Replit lesson (why they switched)
Replit's situation:
Before (Anthropic/Claude):
- Customer base: millions of developers
- Each request: calls Claude API
- Cost per 1000 requests: R$ 750 (Claude price)
- Monthly bill: R$ 500k+ (estimate)
- Cutting into margin
After (OpenAI/GPT-4):
- Same customer base
- Same requests
- Cost per 1000 requests: R$ 300 (OpenAI price)
- Monthly bill: R$ 200k (estimate)
- Savings: R$ 300k/month
For Replit: R$ 3.6M/year savings For you (smaller SaaS): R$ 100k-500k/year savings
Why this matters:
For B2B SaaS:
- Margin = survival
- 150% cost difference = difference between profitable/unprofitable
- At some point: you HAVE to switch
- Or: raise prices 150% (customers leave)
- Or: reduce quality (bad for product)
The real cost of using Claude (Anthropic)
Direct cost (token pricing)
Example: customer support agent
Your agent handles 1000 support tickets/month
Per ticket:
- Customer message: 200 tokens (input)
- Claude processes: 500 tokens (internal reasoning)
- Agent response: 300 tokens (output)
- Total: 1000 tokens per ticket
Monthly:
- 1000 tickets × 1000 tokens = 1M tokens
- Input (200k tokens): 200k × R$ 0.000015 = R$ 3
- Processing (500k tokens): free (internal)
- Output (300k tokens): 300k × R$ 0.000075 = R$ 22.50
- Total: ~R$ 25/month (per 1000 tickets)
But: your customer pays you R$ 50/month
- Your cost: R$ 25
- Your margin: R$ 25 (50%)
- Seems OK
Problem: at scale
- 10,000 customers
- 10M tickets/month
- Cost: R$ 250k/month
- Revenue: R$ 500k/month
- Margin: R$ 250k (50%)
- Seems OK... but
Switch to OpenAI:
- Cost: R$ 100k/month (60% cheaper)
- Revenue: still R$ 500k/month
- Margin: R$ 400k (80%)
- Additional profit: R$ 150k/month = R$ 1.8M/year
Indirect cost (hidden)
What Replit (and you) might not tell investors:
-
Vendor lock-in
- You build product around Claude
- Integration deep (codebase assumes Claude)
- Switching cost: high (rebuild)
- Anthropic knows this
- Raises prices (knowing you're stuck)
-
Context window dependency
- Claude has longest context (200k tokens)
- Perfect for long documents
- Other models: 4k-128k (limited)
- If you need long context: stuck with Claude
-
Quality assumptions
- You promised customers: "Claude-powered, best quality"
- Switch to OpenAI: "Oh, we're using GPT-4 now"
- Customer perception: downgrade (even if not true)
- Churn risk
-
Reliability
- Claude: very reliable (99.9% uptime)
- OpenAI: also reliable (but different SLA)
- Switching: migration complexity
- Risk: bugs, regressions
Why Replit's switch matters (to you)
The signal it sends
Replit is NOT a small startup
Replit (facts):
- Founded 2016
- Raised $150M+
- Profitable (or close)
- VC-backed
- Well-funded
- Can afford Claude
Yet: they switched away from Claude (for cost)
Implication: "If even well-funded companies need to switch for cost... then cost-conscious SaaS has no choice but to multi-provider"
The market implication
Claude's market position:
Before Replit switch:
- "Claude is best quality, worth the cost"
- Developers love Claude
- Anthropic growing (funding rounds)
After Replit switch:
- "Claude is good, but expensive"
- Developers switching to OpenAI (cost)
- Anthropic facing growth pressure
- Price competition intensifies
Future:
- Anthropic might lower prices
- Or: specialize (high-end segment only)
- Or: focus on open source (Llama, etc)
How to choose YOUR LLM provider (practical)
Step 1: Model the cost
Build cost calculator:
python def calculate_llm_cost(monthly_requests, avg_input_tokens, avg_output_tokens): """ Calculate monthly LLM cost by provider """
providers = {
"openai_gpt4": {
"input_price": 0.0075 / 1000,
"output_price": 0.030 / 1000,
},
"claude_opus": {
"input_price": 0.015 / 1000,
"output_price": 0.075 / 1000,
},
"gemini": {
"input_price": 0.0005 / 1000,
"output_price": 0.0015 / 1000,
},
"deepseek": {
"input_price": 0.0001 / 1000,
"output_price": 0.0003 / 1000,
},
}
results = {}
for provider, pricing in providers.items():
input_cost = monthly_requests * avg_input_tokens * pricing["input_price"]
output_cost = monthly_requests * avg_output_tokens * pricing["output_price"]
total_cost = input_cost + output_cost
results[provider] = total_cost
return results
Example
costs = calculate_llm_cost( monthly_requests=10000, avg_input_tokens=200, avg_output_tokens=300 )
for provider, cost in sorted(costs.items(), key=lambda x: x[1]): print(f"{provider}: R$ {cost:,.0f}/month")
Output:
deepseek: R$ 40/month
gemini: R$ 50/month
openai_gpt4: R$ 300/month
claude_opus: R$ 750/month
Step 2: Benchmark quality
Test each model on YOUR use cases:
python def benchmark_models(test_cases): """ Test all models on your specific tasks Measure: quality, speed, cost """
models = [
("openai_gpt4", openai_client),
("claude_opus", anthropic_client),
("gemini", google_client),
]
results = {}
for model_name, client in models:
quality_score = 0
speed_ms = 0
cost = 0
for test_case in test_cases:
start = time.time()
response = client.generate(
prompt=test_case["input"],
model=model_name
)
elapsed = (time.time() - start) * 1000
# Score quality (0-100)
quality = evaluate_response(
response,
expected=test_case["expected_output"]
)
quality_score += quality
speed_ms += elapsed
cost += get_cost(response.tokens)
results[model_name] = {
"quality": quality_score / len(test_cases),
"speed_ms": speed_ms / len(test_cases),
"cost": cost,
}
return results
Example use case: customer support routing
test_cases = [ { "input": "My payment wasn't processed", "expected_output": "billing", }, { "input": "How do I reset my password?", "expected_output": "tech_support", }, # ... more test cases ]
results = benchmark_models(test_cases)
Display results
for model, metrics in results.items(): print(f"{model}:") print(f" Quality: {metrics['quality']:.1f}/100") print(f" Speed: {metrics['speed_ms']:.0f}ms") print(f" Cost: R$ {metrics['cost']:.2f}")
Step 3: Evaluate vendor lock-in risk
Questions to ask:
-
How deep is the integration?
- Using model-specific features? (Claude's long context)
- Using proprietary APIs? (OpenAI's function calling)
- Using open standards? (easy to switch)
-
What's the switching cost?
- Code changes: 1 day? 1 week? 1 month?
- Testing: can you easily A/B test models?
- Rollback: can you quickly revert if new model fails?
-
What if provider raises prices?
- Can you absorb 50% price increase?
- Or: would you be forced to switch?
- Or: forced to raise customer prices?
Step 4: Implement multi-provider strategy
Reduce lock-in: use abstraction layer
python from abc import ABC, abstractmethod
class LLMProvider(ABC): """ Abstract interface for all LLM providers Allows switching without code changes """
@abstractmethod
def generate(self, prompt: str, max_tokens: int) -> str:
pass
@abstractmethod
def get_cost(self, tokens_used: int) -> float:
pass
class OpenAIProvider(LLMProvider): def generate(self, prompt: str, max_tokens: int) -> str: response = openai.ChatCompletion.create( model="gpt-4", messages=[{"role": "user", "content": prompt}], max_tokens=max_tokens ) return response.choices[0].message.content
def get_cost(self, tokens_used: int) -> float:
return tokens_used * 0.030 / 1000 # R$ 0.030 per 1k tokens
class ClaudeProvider(LLMProvider): def generate(self, prompt: str, max_tokens: int) -> str: response = anthropic.Anthropic().messages.create( model="claude-3-opus-20240229", max_tokens=max_tokens, messages=[{"role": "user", "content": prompt}] ) return response.content[0].text
def get_cost(self, tokens_used: int) -> float:
return tokens_used * 0.075 / 1000 # R$ 0.075 per 1k tokens
Usage: easy to switch
class Agent: def init(self, provider: LLMProvider): self.provider = provider
def respond(self, user_input: str) -> str:
response = self.provider.generate(user_input, max_tokens=500)
cost = self.provider.get_cost(len(response.split()))
return response
Switch providers: 1 line
agent = Agent(provider=OpenAIProvider()) # or ClaudeProvider()
Step 5: Monitor actual costs
Track real usage:
python def track_llm_usage(provider_name, tokens_used, response_quality): """ Log usage for cost tracking + quality monitoring """
logging.info(
f"""
LLM Usage:
Provider: {provider_name}
Tokens: {tokens_used}
Cost: R$ {calculate_cost(tokens_used):.2f}
Quality: {response_quality}/100
Efficiency: R$ {calculate_cost(tokens_used) / response_quality:.4f} per quality point
"""
)
# Store for analysis
db.insert({
'provider': provider_name,
'tokens': tokens_used,
'cost': calculate_cost(tokens_used),
'quality': response_quality,
'timestamp': datetime.now()
})
Monthly dashboard
def monthly_cost_report(): """ Show cost by provider + quality metrics """
data = db.query(
"""
SELECT provider, SUM(cost) as total_cost, AVG(quality) as avg_quality
FROM llm_usage
WHERE timestamp >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
GROUP BY provider
ORDER BY total_cost DESC
"""
)
for row in data:
print(f"{row['provider']}:")
print(f" Cost: R$ {row['total_cost']:,.0f}")
print(f" Quality: {row['avg_quality']:.1f}/100")
print(f" Cost/quality: R$ {row['total_cost'] / row['avg_quality']:.2f}")
Replit's decision: what it means for you
Short-term (next 3 months)
-
If you're using Claude:
- Calculate actual monthly cost
- Benchmark OpenAI/Gemini/DeepSeek
- Plan migration strategy
-
If you haven't chosen yet:
- Don't default to Claude (high cost)
- Evaluate all options
- Build abstraction layer (multi-provider)
-
Communicate with customers:
- "We support multiple LLM providers"
- "You can choose which model powers your agent"
- (Differentiator vs. competitors)
Medium-term (3-12 months)
-
Anthropic might:
- Lower prices (to compete)
- Offer volume discounts
- Focus on high-end segment (quality premium)
-
Other providers might:
- Improve quality (close the gap)
- Lower prices (racing to bottom)
- Specialize (coding, reasoning, etc)
-
You should:
- Have multi-provider strategy
- Not be dependent on single model
- Be able to switch based on cost/quality/speed
Long-term (12+ months)
-
Market consolidation:
- 5-10 main providers (down from 20+)
- Price competition (margins compress)
- Quality differentiation (what remains)
-
Your strategy:
- Lock-in mitigation (abstraction layer)
- Cost optimization (multi-provider)
- Quality assurance (benchmarking)
- Regulatory compliance (different models for different use cases)
Conclusion: provider choice matters (now more than ever)
Replit's lesson:
Even successful SaaS companies:
- Switch providers based on cost
- Build multi-provider resilience
- Optimize for margin first, quality second
For your SaaS:
- You WILL eventually face this choice
- Better to plan now than be forced later
- Cost differences are 10x+ (not marginal)
Action plan:
- Model your actual costs (by provider)
- Benchmark on YOUR use cases (not generic benchmarks)
- Build abstraction layer (reduce lock-in)
- Implement multi-provider (resilience)
- Monitor costs monthly (optimize)
- Re-evaluate quarterly (market changes fast)
Reality:
Claude is great. But: cost matters more. OpenAI is cheaper. But: quality might be 90% of Claude. DeepSeek is suspicious. But: cost is 10x lower.
Your job: find YOUR optimal trade-off (cost vs. quality) Not: pick one provider and hope
Seu agent: qual provider? Qual é seu ROI por token? 💰
Publicado em 17 de outubro de 2026