If you can grow or find the raw ingredients, compost is free, though it takes time, some space, and hauling the raw ingredients to the compost heap.
If you can add a few inches of finished compost every year to a bed, after several years the soil won't need added fertilizer unless you grow corn or some other "heavy feeder". Or add 2-6 inches of leaves or slowly-decomposing mulch every year.
Inorganic fertilizer alone is bad for soil, since it doesn't add the carbon that soil organisms need to consume. And you need those soil organisms to keep the root zone healthy. So even if you do add chemical fertilizer, you still need compost.
But if you add enough compost, you won't need chemical fertilizers.
You can't get any cheaper than free!