Reference existing Assistant ID in thread via curl

Following the Assistant tutorial and I’m not seeing a way to handle skipping creating an assistant in step 1.
I already have an assistant_id I’d like to just start a thread directly on that assistant via RESTful operations.
Is this supported?

Sure! The whole idea of Assistants is to create an identity and personality that you can reuse for multiple chats and multiple users.

The ID that you record is not actually put into a thread, or when you add a user message to that thread, but is used when you start a run, which sends the thread for processing against the AI model specified in the assistant ID.

To start a run on a thread with a user message you placed needing answering, you put the thread ID in the URL and the assistant ID in the body:

curl https://api.openai.com/v1/threads/thread_abc123/runs \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "OpenAI-Beta: assistants=v2" \
  -d '{
    "assistant_id": "asst_abc123"
  }'

Then you have to check the status of the thread’s run to see when it has transitioned status to “completed”

curl https://api.openai.com/v1/threads/thread_abc123/runs/run_abc123 \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "OpenAI-Beta: assistants=v2"

retrieve run response:

{
  "id": "run_abc123",
  "object": "thread.run",
  "created_at": 1698107661,
  "assistant_id": "asst_abc123",
  "thread_id": "thread_abc123",
  "status": "completed",
 ...
}

Then you’ve got a new message waiting!