Automatic protection from the AI tax on failureEver get charged for an AI request that returned absolutely nothing? Those moments when the model crashes, times out, or just decides to take a coffee break on your dime? Zero Completion Insurance has your backβautomatically, completely, forever.
Set it and forget it (because itβs already set)Zero Completion Insurance is always on. No toggles, no settings, no premium plans. Every single request is automatically protected from day one.The system watches for:
# Big request that times outpayload = { "model": "anthropic/claude-3-5-sonnet-20241022", "messages": [ {"role": "user", "content": "Analyze this 50-page document..."} ]}try: response = requests.post(url, headers=headers, json=payload, timeout=30) result = response.json() # Even if provider times out and you get nothing useful if result.get("billing", {}).get("zero_completion_insurance"): print("Timeout occurred - Zero Completion Insurance saved you money!") print(f"Credits charged: ${result['billing']['credits_used']}") # Will be 0except requests.exceptions.Timeout: print("Request timed out completely - no charges apply")
def check_insurance_savings(): """See how much Zero Completion Insurance has saved you""" activity_response = requests.get( "https://api.anyapi.ai/api/v1/activity", headers={"Authorization": f"Bearer {API_KEY}"} ) activity_data = activity_response.json() protected_requests = [ req for req in activity_data["requests"] if req.get("credits_used", 0) == 0 and req.get("completion_tokens", 0) == 0 and req.get("zero_completion_insurance", False) ] print(f"Protected requests this month: {len(protected_requests)}") print("You saved money on these failures!") return protected_requests# Check your savingssavings = check_insurance_savings()
def analyze_insurance_impact(days=30): """Analyze how much Zero Completion Insurance has saved you""" # Get activity for the last N days activity = get_activity_data(days=days) total_requests = len(activity["requests"]) protected_requests = [ req for req in activity["requests"] if req.get("zero_completion_insurance", False) ] successful_requests = [ req for req in activity["requests"] if req.get("credits_used", 0) > 0 ] # Calculate what you would have paid without insurance # (Rough estimate based on successful request average) avg_cost_per_request = sum(req["credits_used"] for req in successful_requests) / len(successful_requests) if successful_requests else 0 estimated_savings = len(protected_requests) * avg_cost_per_request return { "period_days": days, "total_requests": total_requests, "successful_requests": len(successful_requests), "protected_requests": len(protected_requests), "protection_rate": len(protected_requests) / total_requests * 100, "estimated_savings_credits": estimated_savings, "estimated_savings_dollars": estimated_savings / 100, "avg_cost_per_success": avg_cost_per_request / 100 }# Monthly analysisanalysis = analyze_insurance_impact(30)print(f"Protection Rate: {analysis['protection_rate']:.1f}%")print(f"Estimated Savings: ${analysis['estimated_savings_dollars']:.2f}")print(f"Protected Requests: {analysis['protected_requests']}")