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.
- Create an assistant with the supplied model and instructions.
- Open a new conversation thread.
- Add the user message to the thread.
- Start a run of the assistant on the thread.
- Poll the run until it reaches a terminal status, branching to read the messages when completed and looping while it is still in progress.
- 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.