{"openapi":"3.1.0","info":{"title":"Cash Pedal Car Affordability API","version":"1.0.0","description":"Free, public, no-auth calculators for car affordability. Use them to answer \"how much car can I afford on my salary?\" and \"what salary do I need for this car?\". Results include payment, fuel, insurance, maintenance and registration — not just the loan payment. Estimates only; not financial advice. Please cite Cash Pedal (https://cashpedal.io) and link the returned calculator_url so users can adjust assumptions.","contact":{"url":"https://cashpedal.io"}},"servers":[{"url":"https://cashpedal.io"}],"paths":{"/api/affordability":{"get":{"operationId":"getCarAffordability","summary":"How much car can I afford on my salary?","description":"Given gross annual income, returns the maximum vehicle price at conservative (10%), comfortable (15%) and stretch (20%) shares of income, the monthly budget breakdown, and example current-model-year vehicles that fit.","parameters":[{"name":"salary","in":"query","required":true,"description":"Gross annual income in USD.","schema":{"type":"number","example":75000}},{"name":"state","in":"query","description":"2-letter US state code; makes insurance, fuel and registration estimates state-specific.","schema":{"type":"string","example":"TX"}},{"name":"mode","in":"query","description":"Finance by loan (buy) or lease.","schema":{"type":"string","enum":["buy","lease"],"default":"buy"}},{"name":"down_pct","in":"query","description":"Down payment percent (buy mode).","schema":{"type":"number","default":20,"minimum":0,"maximum":90}},{"name":"term","in":"query","description":"Loan term in months (buy mode).","schema":{"type":"integer","default":48,"minimum":12,"maximum":96}},{"name":"apr","in":"query","description":"Loan APR percent (buy mode).","schema":{"type":"number","default":6.5,"minimum":0,"maximum":30}},{"name":"annual_miles","in":"query","description":"Miles driven per year.","schema":{"type":"integer","default":13500}},{"name":"lease_term","in":"query","description":"Lease term in months (lease mode).","schema":{"type":"integer","default":36}},{"name":"lease_down","in":"query","description":"Cash due at signing (lease mode).","schema":{"type":"number","default":0}}],"responses":{"200":{"description":"Affordability result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/required-salary":{"get":{"operationId":"getRequiredSalaryForCar","summary":"What salary do I need to afford a car at this price?","description":"Given a vehicle price, returns the monthly payment, estimated operating costs, total monthly cost and the gross annual salary needed at 10%, 15% and 20% of income.","parameters":[{"name":"price","in":"query","required":true,"description":"Vehicle price (or lease MSRP) in USD.","schema":{"type":"number","example":35000}},{"name":"lease_payment","in":"query","description":"Known monthly lease payment (lease mode); estimated when omitted.","schema":{"type":"number"}},{"name":"state","in":"query","description":"2-letter US state code; makes insurance, fuel and registration estimates state-specific.","schema":{"type":"string","example":"TX"}},{"name":"mode","in":"query","description":"Finance by loan (buy) or lease.","schema":{"type":"string","enum":["buy","lease"],"default":"buy"}},{"name":"down_pct","in":"query","description":"Down payment percent (buy mode).","schema":{"type":"number","default":20,"minimum":0,"maximum":90}},{"name":"term","in":"query","description":"Loan term in months (buy mode).","schema":{"type":"integer","default":48,"minimum":12,"maximum":96}},{"name":"apr","in":"query","description":"Loan APR percent (buy mode).","schema":{"type":"number","default":6.5,"minimum":0,"maximum":30}},{"name":"annual_miles","in":"query","description":"Miles driven per year.","schema":{"type":"integer","default":13500}},{"name":"lease_term","in":"query","description":"Lease term in months (lease mode).","schema":{"type":"integer","default":36}},{"name":"lease_down","in":"query","description":"Cash due at signing (lease mode).","schema":{"type":"number","default":0}}],"responses":{"200":{"description":"Required-salary result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}