Keflex (Cephalexin) for Pyelonephritis
Keflex is NOT a first-line agent for acute pyelonephritis and should only be used when preferred agents (fluoroquinolones, TMP-SMX, or IV ceftriaxone) cannot be used, and must be combined with an initial IV dose of ceftriaxone or an aminoglycoside. 1
Why Keflex is Suboptimal
The IDSA/ESMID guidelines explicitly state that oral β-lactam agents are less effective than other available agents for treatment of pyelonephritis 1. This is a critical distinction—while cephalexin may work for uncomplicated cystitis, pyelonephritis represents upper tract infection requiring more reliable tissue penetration and bactericidal activity.
When Keflex Can Be Considered
If you must use an oral β-lactam like cephalexin for pyelonephritis:
- Always give an initial IV dose of ceftriaxone 1g or a consolidated 24-hour aminoglycoside dose first 1
- Duration: 10-14 days (the guidelines note insufficient data to recommend shorter courses with β-lactams) 1
- Obtain urine culture and susceptibilities before starting therapy 1
- Only use if the organism is proven susceptible and other options are contraindicated
Preferred First-Line Options
For outpatient pyelonephritis treatment, prioritize:
- Ciprofloxacin 500mg PO BID × 7 days (if local fluoroquinolone resistance <10%) 1
- Levofloxacin 750mg PO daily × 5 days (if local fluoroquinolone resistance <10%) 1
- TMP-SMX 160/800mg PO BID × 14 days (if organism known susceptible) 1
If fluoroquinolone resistance exceeds 10% in your area, give an initial IV dose of ceftriaxone 1g or aminoglycoside before starting oral therapy 1.
Supporting Evidence Nuances
Recent research suggests oral cephalosporins may perform better than historically reported. A 2022 study found no significant difference in UTI recurrence rates between oral cephalosporins and first-line agents for pyelonephritis (16% vs 17%, P=0.851) 2. A 2025 comparison of cefdinir versus cephalexin showed no difference in composite treatment failure (8% vs 14.1%, P=0.193) 3.
However, these studies conflict with the established guideline recommendations. The 2024 WikiGuidelines consensus reinforces that β-lactams should not be used if other treatment options exist due to concerns about efficacy and ecological collateral damage 4.
Critical Pitfalls to Avoid
- Never use cephalexin as monotherapy for pyelonephritis without the initial IV dose
- Do not use shorter durations (5-7 days) with β-lactams—stick to 10-14 days 1
- Avoid in patients with prior UTI or anatomical abnormalities where treatment failure risk is higher 5
- Monitor patients on metformin closely as cephalexin increases metformin levels by 24-34% 6
Practical Algorithm
For suspected pyelonephritis:
- Obtain urine culture immediately
- Check local antibiogram for fluoroquinolone resistance rates
- If resistance <10%: Start ciprofloxacin or levofloxacin
- If resistance >10%: Give IV ceftriaxone 1g, then start oral fluoroquinolone or TMP-SMX
- Only use cephalexin if:
- Patient has documented allergy/intolerance to fluoroquinolones AND TMP-SMX
- Give IV ceftriaxone 1g first
- Prescribe cephalexin 500mg QID × 10-14 days
- Ensure close follow-up at 48-72 hours