The crossover calculation is not complicated and we do it in the open: take your projected monthly token volume, price it at the API rate you would actually pay, and compare it against the monthly cost of ownership — hardware amortised over three years, plus power, plus a realistic fraction of an engineer. The number that decides it is usually the last one, and it is the one most comparisons leave out.
Two honest observations from doing this repeatedly. First, the arithmetic favours ownership sooner than most people expect once volume is genuinely sustained, because API pricing is linear and hardware is not. Second, it favours the API far longer than vendors of hardware will tell you when volume is spiky, because an idle GPU costs the same as a busy one.