capabilities.work

Assistant Run

A 6-step recipe with OpenAI. We can help you get access.

Recipe · 6 steps

Assistant Run

with OpenAI

Create an assistant and run a thread to completion, returning the reply.

  1. Create an assistant with the supplied model and instructions.
  2. Open a new conversation thread.
  3. Add the user message to the thread.
  4. Start a run of the assistant on the thread.
  5. Poll the run until it reaches a terminal status, branching to read the messages when completed and looping while it is still in progress.
  6. List the thread messages and return the most recent assistant reply.
What you'll need to have ready
  • apiKey: OpenAI API key used as a Bearer token.
  • model: The model id for the assistant and run (e.g. gpt-4o).
  • instructions: The system instructions for the assistant.
  • userMessage: The user message to add to the thread.
For your developer

Arazzo workflow openai:assistant-run, 6 operations: createAssistant → createThread → createMessage → createRun → getRun → listMessages. Specs on APIs.io.