OpenAI Assistants API
Most model APIs forget everything the moment they reply, so you resend the whole conversation on every turn. The OpenAI Assistants API, introduced in late 2023, took the opposite position: the conversation lives on OpenAI's servers, and your code pokes at it.
The object model
Four nouns carry the whole design:
- An assistant — instructions, a model and a set of enabled tools — created once and reused.
- A thread: a server-side conversation you append messages to, with history and trimming managed for you.
- A run: the act of pointing an assistant at a thread. You poll its status while the service executes the loop.
- Built-in tools — code interpreter, a sandboxed Python environment, and file search, managed retrieval over uploaded documents — alongside your own functions.
Where the control sits
The loop runs inside the API, which is both the appeal and the catch. When the model wants one of your functions, the run parks in a requires-action state until you submit the tool outputs; everything else happens out of sight. You get threading, retrieval and file handling without building any of it, and in exchange you cannot see or change how steps are ordered, how context is trimmed, or when the loop gives up.
Why it matters
It was the first mainstream statement that agent state belongs on the server, and it shaped what followed — OpenAI now directs new work to the Responses API, which keeps the stateful idea while exposing the loop more honestly. Reading agent code written in the Assistants era, this is the vocabulary it uses.
The OpenAI Assistants API is a stateful interface for building assistants: a persistent assistant (instructions, model, tools) is pointed at a server-side thread of messages, and each run executes the agent loop inside the API, including its code-interpreter and file-search tools. It removed the need to manage conversation state and retrieval yourself, at the cost of control over the loop. OpenAI now directs new projects to the Responses API.
Normally, every time you talk to an AI model you have to resend the entire conversation, because the model itself remembers nothing. The OpenAI Assistants API was built to take that chore away.
You set up a helper once, describing its job and what it is allowed to do. The conversation then lives on OpenAI's own servers, like a chat thread that stays put between visits. Each time you want work done, you nudge that thread and the service handles the back-and-forth itself — including running small programs or searching through documents you uploaded. It made building a working assistant much quicker, in return for seeing less of how each step gets decided.