I looked at the documentation you linked, and some of the links are no longer up to date, e.g:
I write in JavaScript, I use the openAI library, I make a small library for Vue and React and I don’t like backend options.
I guess it’s possible to do what I need with the Completions endpoint: "If you’re using a small dataset (<10,000 documents), consider using the techniques described in that guide to finding the best documents to construct a prompt similar to this. Then, you can just submit that prompt to our Completions endpoint. - only I don’t really understand how it should work in the example.