Skip to main content

OpenAI Assistants API

Build persistent AI assistants with memory, tools, and file knowledge — no session management needed

AgentsPaid

The OpenAI Assistants API provides infrastructure for building AI assistants that persist across conversations, use tools (code interpreter, file search, function calling), and maintain thread-based conversation history. Instead of managing conversation state yourself, Assistants handles threads, runs, and tool execution — letting you focus on building the assistant's capabilities.

This tool appears to be discontinued. OpenAI shut down the Assistants API on 26 August 2026. Its features moved to the Responses API and Conversations API.

Key specs
1,000,000,000 Threads created source
as of 2026-03-27

What we know

PricingPaidfrom our original listing, not yet re-checked

Why it matters

  • Eliminates session management boilerplate — threads and runs handle conversation history and context window management automatically.
  • Code Interpreter enables AI that executes Python and analyzes data — far more powerful than text-only assistants for data, math, and analysis tasks.
  • File Search (built-in RAG) lets non-engineers add document knowledge to assistants without building vector databases and retrieval pipelines.
  • Function calling with automatic retry loop handles multi-step tool use without building state machines — the assistant keeps trying until it completes the task.

Key capabilities

  • Persistent threads: Conversation history stored and managed by OpenAI — no session state in your code.
  • Code Interpreter: Execute Python in a sandbox; generate charts, analyze files, perform calculations.
  • File Search: Upload PDFs, DOCX, and other files; assistant retrieves relevant content (built-in RAG).
  • Function calling: Define functions; assistant calls them; results feed back into conversation.
  • Multi-step tool use: Assistant automatically retries and combines tool calls to complete complex tasks.
  • Streaming: Stream assistant responses token-by-token via the streaming runs API.
  • Model selection: choose an OpenAI model per assistant.
  • File management: Upload, store, and reference files across multiple threads and assistants.

Technical notes

  • API: POST /v1/assistants, /v1/threads, /v1/runs
  • SDK: openai.beta.assistants in Python and Node.js SDKs
  • Models: OpenAI GPT models
  • Tools: Code Interpreter ($0.03/session), File Search ($0.20/GB/day), Function Calling (free)
  • Pricing: Model tokens + tool usage (see above)
  • Context: Automatic context management; oldest messages truncated if over limit

Ideal for

  • Customer-facing AI assistants that need persistent conversation history across multiple sessions.
  • Data analysis applications where users upload files and ask questions about them.
  • Multi-step task automation where the AI needs to execute code, call APIs, and iterate on results.

Not ideal for

  • Simple single-turn completions — Chat Completions API is faster, cheaper, and simpler.
  • Applications requiring sub-second latency — Assistants API has overhead from state management.
  • Teams who need full control over RAG, retrieval, and conversation management — build your own with LangChain or LlamaIndex.

See also

  • LangChain — Build similar AI agents with more control and customization.
  • OpenAI Python SDK — The SDK used to call the Assistants API.
  • Vercel AI SDK — TypeScript SDK for building AI chat UIs that can connect to Assistants API.

FAQ

What is the OpenAI Assistants API?

The Assistants API is OpenAI's managed framework for building AI assistants. You create an Assistant (with a system prompt and tools), create Threads (conversation history), add Messages to threads, and create Runs (execute the assistant on a thread). OpenAI manages the conversation context, tool execution loop, and state persistence. Built-in tools: code interpreter (Python execution), file search (RAG over uploaded files), and function calling.

Is the Assistants API free?

The Assistants API charges for: model tokens (same as Chat Completions API), code interpreter at $0.03/session, and file storage at $0.20/GB/day. There are no separate Assistants API fees beyond these. For simple chatbots without code interpreter or file search, the cost is the same as direct Chat Completions. Files used for retrieval are billed per storage.

When should I use the Assistants API vs. Chat Completions?

Use the Assistants API when you need: (1) Persistent multi-turn conversations that outlast a single API call; (2) Built-in code execution (code interpreter runs Python, generates charts); (3) File-based retrieval (upload documents, ask questions about them); (4) Multi-step tool use with automatic retry. Use Chat Completions when you need simplicity, maximum control over conversation management, or lower latency.

What is the code interpreter tool?

Code Interpreter lets the assistant write and run Python code in a sandboxed environment. The assistant can: perform calculations, analyze data, generate charts and visualizations (returned as image files), process uploaded files (CSV, Excel, images), and iterate on code until it gets the correct answer. It runs in OpenAI's infrastructure — no server needed.

Alternatives

Is your tool an alternative to OpenAI Assistants API? Sponsor this spot for 30 days, marked Sponsored.

Integrations

None listed.

Built on

None listed.

Good for these tasks

Listed 2026-02-28 · updated 2026-11-12