Be aware the haystack test is not good at all (in its current form). It's a single piece of information inserted in the same text each time, a very poor measurement of how well the LLM can retrieve info.
Then if you want to test for recall of sparse information or multi-hop information, it's useless.
Here's a quick start guide with OpenAI: https://platform.openai.com/docs/quickstart?context=python