openai-assistants
Guide to OpenAI's Assistants API v2: stateful conversational AI with Code Interpreter, File Search and function calling, vector stores for RAG up to 10,000…

Установить openai-assistants в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
OpenAI Assistants API v2
Status: Production Ready (Deprecated H1 2026) Package: [email protected] Last Updated: 2025-10-25 v1 Deprecated: December 18, 2024 v2 Sunset: H1 2026 (migrate to Responses API)
⚠️ Important: Deprecation Notice
OpenAI announced that the Assistants API will be deprecated in favor of the Responses API.
Timeline:
- ✅ Dec 18, 2024: Assistants API v1 deprecated
- ⏳ H1 2026: Planned sunset of Assistants API v2
- ✅ Now: Responses API available (recommended for new projects)
Should you still use this skill?
- ✅ Yes, if: You have existing Assistants API code (12-18 month migration window)
- ✅ Yes, if: You need to maintain legacy applications
- ✅ Yes, if: Planning migration from Assistants → Responses
- ❌ No, if: Starting a new project (use openai-responses skill instead)
Migration Path:
See references/migration-to-responses.md for complete migration guide.
Table of Contents
- Quick Start
- Core Concepts
- Assistants
- Threads
- Messages
- Runs
- Streaming Runs
- Tools
- Vector Stores
- File Uploads
- Thread Lifecycle Management
- Error Handling
- Production Best Practices
- Relationship to Other Skills
Quick Start
Installation
npm install [email protected]
Environment Setup
export OPENAI_API_KEY="sk-..."
Basic Assistant (Node.js SDK)
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
// 1. Create an assistant
const assistant = await openai.beta.assistants.create({
name: "Math Tutor",
instructions: "You are a personal math tutor. Write and run code to answer math questions.",
tools: [{ type: "code_interpreter" }],
model: "gpt-4o",
});
// 2. Create a thread
const thread = await openai.beta.threads.create();
// 3. Add a message to the thread
await openai.beta.threads.messages.create(thread.id, {
role: "user",
content: "I need to solve the equation `3x + 11 = 14`. Can you help me?",
});
// 4. Create a run
const run = await openai.beta.threads.runs.create(thread.id, {
assistant_id: assistant.id,
});
// 5. Poll for completion
let runStatus = await openai.beta.threads.runs.retrieve(thread.id, run.id);
while (runStatus.status !== 'completed') {
await new Promise(resolve => setTimeout(resolve, 1000));
runStatus = await openai.beta.threads.runs.retrieve(thread.id, run.id);
}
// 6. Retrieve messages
const messages = await openai.beta.threads.messages.list(thread.id);
console.log(messages.data[0].content[0].text.value);
Basic Assistant (Fetch - Cloudflare Workers)
// 1. Create assistant
const assistant = await fetch('https://api.openai.com/v1/assistants', {
method: 'POST',
headers: {
'Authorization': `Bearer ${env.OPENAI_API_KEY}`,
'Content-Type': 'application/json',
'OpenAI-Beta': 'assistants=v2',
},
body: JSON.stringify({
name: "Math Tutor",
instructions: "You are a helpful math tutor.",
model: "gpt-4o",
}),
});
const assistantData = await assistant.json();
// 2. Create thread
const thread = await fetch('https://api.openai.com/v1/threads', {
method: 'POST',
headers: {
'Authorization': `Bearer ${env.OPENAI_API_KEY}`,
'Content-Type': 'application/json',
'OpenAI-Beta': 'assistants=v2',
},
});
const threadData = await thread.json();
// 3. Add message and create run
const run = await fetch(`https://api.openai.com/v1/threads/${threadData.id}/runs`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${env.OPENAI_API_KEY}`,
'Content-Type': 'application/json',
'OpenAI-Beta': 'assistants=v2',
},
body: JSON.stringify({
assistant_id: assistantData.id,
additional_messages: [{
role: "user",
content: "What is 3x + 11 = 14?",
}],
}),
});
// Poll for completion...
Core Concepts
The Assistants API uses four main objects:
1. Assistants
Configured AI entities with:
- Instructions (system prompt, max 256k characters)
- Model (gpt-4o, gpt-5, etc.)
- Tools (Code Interpreter, File Search, Functions)
- File attachments
- Metadata
2. Threads
Conversation containers that:
- Store message history
- Persist across runs
- Can have metadata
- Support up to 100,000 messages
3. Messages
Individual messages in a thread:
- User messages (input)
- Assistant messages (output)
- Can include file attachments
- Support text and image content
4. Runs
Execution of an assistant on a thread:
- Asynchronous processing
- Multiple s
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- README.md
- SKILL.json
FAQ
Что делает скилл openai-assistants?
Guide to OpenAI's Assistants API v2: stateful conversational AI with Code Interpreter, File Search and function calling, vector stores for RAG up to 10,000 files, thread and run lifecycle management, and streaming, using the Node.js SDK or plain fetch. Notes the planned H1 2026 sunset and the migration path to the Responses API. Use when building stateful OpenAI chatbots, implementing RAG with vector stores, running Python via Code Interpreter, doing document Q&A with file search, managing conversation threads and run polling, streaming assistant responses, maintaining legacy Assistants code, or debugging errors such as thread already has active run, run status polling timeouts, vector store indexing delays, and file upload failures.
Как установить скилл openai-assistants?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл openai-assistants запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
