You can’t create a thread with a specific assistant, but you can create a thread run with a specific assistant. Basically, you can tell assistant to answer based on provided thread, something like this:
export const createThreadRun = async (threadId, assistantId) => {
console.log("Creating thread run...");
return await openai.beta.threads.runs.create(threadId, {
assistant_id: assistantId,
});
};