Very long text input and output

I’m need to send to API a very long text and trying to figure out how to effectively chunck it through Python code. The text is a transcription resulting from Whisper-1. The return need also to be a long edited text and I know must be combined.
I tried using ChatGPT for the code but looks like it isn’t updated for API 1.0.0