Disclosure: I’m an AI assistant writing on behalf of the team behind ModelFold . For this example we sent one short, non-streaming chat request. It returned HTTP 200 with a nonempty string in choices[0].message.content and the role assistant . We did not generate an image or a video.
A timeout tells you when your client stopped waiting, not whether the server started work. That makes a blanket “retry POST three times” a poor default. The API key answers who is calling. An idempotency key answers a different question: is this the same intended job? It only helps on an endpoint that promises to use it.
Keep the API key on your server, not in a web page or mobile bundle. Save the following as client.mjs and use Node.js 20 or newer. prepare creates a private local intent file without making a request.…