If you got on with the CTO, I would reach out to them and ask if they could be your reference. Since they outrank your manager, most companies will happily take a reference from them, especially if you worked with them directly a bit.
It might be a tricky political conversation, but if you suggest that you were disappointed how things ended, and you know how sometimes your manager can, how shall we say, put things in a negative light, they really ought to be willing.
(If you're somewhere with labour laws, consider talking to a lawyer, and be willing to threaten to get a good reference and a resignation, not a firing.)
Any new company, just give the CTO as the reference. If asked about it, just say something like they were best placed to assess you during your time at the company where you worked with a variety of people.
ALSO, there was another team that I think I would have been a much better fit for (tech lead actually gave a shit about programming and gave people autonomy) but unfortunately I did not take the initiative to switch over.
I have references from other people at the company as well, including the CTO, that I actually liked working with, and they liked working with me. Unfortunately they were not on my team.