openai-assistants-builder

openai-assistants-builder is a skill for Claude Code, Codex from khalilbenaz/claude-skills-collection. It costs 116 tokens per session (2,625 once invoked), scanned A, original, MIT.

A guide for building hosted AI assistants with OpenAI's Assistants API. It covers persistent conversation threads, searching uploaded files, running Python code, calling functions, and streaming responses.

In plain words
What is it for?
Use it to create assistants that remember conversations, answer questions from files, analyze data with Python, call application functions, or stream replies.
Why use it?
It helps choose between the Assistants API and direct chat requests based on needs such as memory, file search, response speed, cost, and control over conversation context.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to create assistants that remember conversations, answer questions from files, analyze data with Python, call application functions, or stream replies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khalilbenaz/claude-skills-collection/openai-assistants-builder
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add khalilbenaz/claude-skills-collection --skill openai-assistants-builder
Clone the repo
git clone --depth 1 https://github.com/khalilbenaz/claude-skills-collection

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openai-assistants-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/openai-assistants-builder/github.svg)](https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/openai-assistants-builder)
Your own site
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/openai-assistants-builder"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/openai-assistants-builder/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for openai-assistants-builder

Your own site · 80×15
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/openai-assistants-builder"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/openai-assistants-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,625 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 79
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00116 $0.02625
Opus 5 $0.00058 $0.01313
Sonnet 5 $0.00023 $0.00525
Haiku 4.5 $0.00012 $0.00263

Measured 13d ago against content hash a1c5ca3085b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

openai-assistants-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agent-skills/openai-assistants-builder/SKILL.md · 279 lines

How it starts

The opening of the file, as written. The whole thing — 279 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenAI Assistants Builder — API Assistants v2

Critères de décision : Assistants API vs Chat Completions

Besoin Assistants API Chat Completions
Mémoire de conversation persistante ✅ Threads gérés par OpenAI ❌ À gérer soi-même
Recherche sémantique dans des fichiers ✅ file_search natif ❌ RAG custom requis
Exécution de code Python ✅ code_interpreter sandbox ❌ Sandbox custom requis
Latence minimale (< 500ms) ❌ Overhead run lifecycle ✅ Réponse directe
Contrôle total du contexte ❌ Géré par OpenAI ✅ Contrôle complet
Coût optimisé (volume élevé) ❌ + coût tools/storage ✅ Tokens seuls

Choisir Assistants API pour les MVP avec RAG ou analyse de données sans backend complexe. Choisir Chat Completions quand la latence, le coût, ou le contrôle du contexte sont prioritaires.

Workflow en 10 étapes

1. Installation et initialisation

pip install openai>=1.57.0 tenacity
from openai import OpenAI
import os

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

# Azure OpenAI (optionnel) :
# from openai import AzureOpenAI
# client = AzureOpenAI(
#     azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
#     api_key=os.environ["AZURE_OPENAI_KEY"],
#     api_version="2024-05-01-preview",
# )

2. Création de l'assistant (une seule fois)

assistant = client.beta.assistants.create(
    name="Assistant Commercial",
    model="gpt-4o",                        # ou gpt-4o-mini pour réduire les coûts
    instructions=(
        "Vous êtes un assistant commercial expert. "
        "Répondez en français, citez vos sources documentaires. "
        "Soyez concis et professionnel."
    ),
    tools=[
        {"type": "file_search"},
        {"type": "code_interpreter"},
        {
            "type": "function",
            "function": {
                "name": "get_product_price",
                "description": "Consulte le prix d'un produit dans le catalogue",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "product_id": {"type": "string", "description": "ID produit (ex: PROD001)"}
                    },
                    "required": ["product_id"],
                },
            },
        },
    ],
    temperature=0.2,                       # Réduire pour des réponses plus déterministes
    response_format="auto",                # ou {"type":"json_object"} pour JSON structuré
)

# IMPORTANT : stocker cet ID — ne jamais recréer l'assistant à chaque appel
print(f"ASSISTANT_ID={assistant.id}")      # Persister dans .env ou config

Read the full file on GitHub · 279 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 279 lines · 116 tokens per session scan A a1c5ca3085b3

Subscribe to this mod's changes

openai-assistants-builder is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (22 stars, last pushed 19d ago), licensed MIT. It adds 116 tokens to every session and 2,625 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

llm-integration

Integrate OpenAI and Anthropic APIs with streaming, structured output, tool calling, token management, and cost optimization.

medy-gribkov/arcana · 28 tokens

sglang

Fast structured generation and serving for LLMs with RadixAttention prefix caching. Use for JSON/regex outputs, constrained decoding, agentic workflows with tool calls, or when you need 5× faster inference than vLLM with prefix sharing. Powers 300,000+ GPUs at xAI, AMD, NVIDIA, and LinkedIn.

davila7/claude-code-templates · 72 tokens

llm-provider

Adds a new LLM provider implementing LLMProvider interface with call() and stream() methods. Integrates with provider factory in src/llm/index.ts, config detection in src/llm/config.ts, and error handling via tracking and recovery. Use when adding a new model backend, integrating a third-party LLM API, or extending…

caliber-ai-org/ai-setup · 100 tokens

calling-llms

Use when sending chat completions through liter-llm and routing to a specific provider via the provider/model prefix. Covers the chat call shape, provider routing, modelhint, message roles, and error categories.

xberg-io/liter-llm · 49 tokens

streaming-responses

Use when streaming tokens incrementally from an LLM via liter-llm over SSE or async iterators. Covers chatstream, delta handling, and null-content chunks.

xberg-io/liter-llm · 39 tokens

api-patterns

API design: naming, versioning, pagination, idempotency, OpenAPI, error contracts and safe retries. Triggers: API design, REST, GraphQL, OpenAPI, Swagger, error response, HTTP status, rate limit.

softspark/ai-toolkit · 52 tokens