How can I only prompt one time and get the results

I am dealing with a news processing, and it contains 2.8m news in the dataset I want to process. Do I have to send the prompt every time I send the message to the api? Or will the prompt only count once if I send it as system prompt? The prompt is the instruction I want gpt to follow and return the results it processes. What should I do to save money and only count the prompt once? Is it possible? Thanks

Welcome to the community!

No matter what you do, everything you send, or is processed, will be billed every time.

You might however want to look at prompt caching (https://platform.openai.com/docs/guides/prompt-caching) which may help you achieve some discounts on what you’re doing.

You may also want to look at the batch API (https://platform.openai.com/docs/guides/batch), of course, if you’re doing offline processing.

1 Like

Optimize your prompt via o1 model for size…
Segment your dataset to the input window size for the model (check the docs), then ask the prompt once and request a json formatted reply for each article.
But your savings will be minimal, likely.

It helped me, Thank you so much.