[ ABORT TO HUD ]
SEQ. 1

Threads, Runs & Tools

📦 Assistants API (Legacy) 18 min 250 BASE XP

The Legacy Stateful API

The Assistants API was OpenAI's first attempt at stateful AI infrastructure. While now superseded by the Responses API for new projects, many production systems still use it.

Core Concepts

  • Assistant: An AI entity with custom instructions, a model choice, and enabled tools.
  • Thread: A persistent conversation session. You add Messages to a Thread.
  • Message: Text or files added to a Thread by a user or Assistant.
  • Run: The execution of an Assistant on a Thread (asynchronous).

The Workflow

  1. Create an Assistant with instructions and tools.
  2. Create a Thread when a user starts a conversation.
  3. Add a User Message to the Thread.
  4. Create a Run to process the Thread.
  5. Poll or stream the Run status until complete.
  6. Retrieve the Assistant's response Messages.

Built-in Tools

ToolPurpose
File SearchRAG over uploaded files (up to 10,000 per Vector Store)
Code InterpreterPython sandbox for data analysis and file processing
Function CallingCustom tool execution via requires_action status
⚠️ Migration Note: The Assistants API still works but receives no new features. All new capabilities (web search, CUA, MCP, prompt caching) are Responses API only. Migrate when possible.
SYNAPSE VERIFICATION
QUERY 1 // 3
How does the Assistants API differ from Chat Completions?
It doesn't support history
It is stateful — managing conversation history in Threads automatically
It requires SQL
It only remembers the last prompt
Watch: 139x Rust Speedup
Threads, Runs & Tools | Assistants API (Legacy) — OpenAI Academy