Facing challenges due to token limitations

I hope this message finds you well.

I am currently developing a product designed to generate over 100 pages of documents by leveraging OpenAI and the Perplexity API. However, I am facing challenges due to token limitations. Providing the document’s context in each input consumes a significant number of tokens, which restricts the ability to generate the desired number of pages in a single process.

I was wondering if any solution could help address this limitation. Specifically, I am looking for a way to optimize token usage or an alternative approach that enables seamless generation of extensive multi-page documents without compromising the context or output quality.

I would appreciate your insights and any suggestions you may have to overcome this issue.

Thank you for your time and support.

Have you tried Gemini and its 1/2 million context window? Also consider summarization of generated pages (You can even have those generated as part of each page of chapter). And then feeding those summaries, not the full output to the next chapter/pages?

User enter below prompts:
I need to develop a brd document for an ai solution / tutor that helps students to learn to read by evaluating their abilities and helping them improve vocabulary and comprehension

User need to generate a document of more than 100 pages so in this way I face challenge in token limitation, if I split into chunks like first generate sections or chapters than merge all at once so it will take too time and there will be context issue, answers can be irrelevant