Tutorial 14 min read

Build Your First AI Assistant with the OpenAI API in 2026

Start with the modern stack: the Responses API, current models, and a minimal tool layer to build a safe first assistant.

RC
Rupert Chesman
AI Educator · Filmmaker
Updated May 2026

Key Takeaway

The current OpenAI path is to build on the Responses API with a current model, one or two tools, explicit instructions, and a simple state strategy. The Assistants API is deprecated.

The Modern Beginner Path

Building an AI assistant with the OpenAI API has changed significantly since 2024. The Assistants API is deprecated. The current path is the Responses API, which provides a cleaner interface for building assistants with tool use, structured outputs, and multi-turn conversations.

This tutorial walks through building a simple but functional AI assistant. The Vibe Coding course extends this into more complex applications.

Step 1: Start with the Quickstart

Begin with OpenAI's official quickstart. Install the Python SDK, set up your API key, and make your first API call. This should take less than 10 minutes.

Installation pip install openai
export OPENAI_API_KEY="your-key-here"
First API Call from openai import OpenAI
client = OpenAI()

response = client.responses.create(
  model="gpt-5.5",
  input="Explain what an AI assistant is in two sentences."
)

print(response.output_text)

If this returns a sensible response, your setup is correct.

Step 2: Pick a Current Model

For a first assistant, use gpt-5.5 or gpt-5.5-mini for development. Key considerations:

  • gpt-5.5: Best balance of capability and cost for production. Good instruction following and tool use.
  • gpt-5.5-mini: Cheaper, faster, suitable for simpler tasks and development.

Start with gpt-5.5. You can upgrade or downgrade later without changing code.

Step 3: Define the Job

Before writing more code, define what your assistant will do. A good first assistant has a narrow, specific job:

  • Answer questions about company documentation.
  • Help users draft emails in a specific style.
  • Analyse CSV data and produce summary reports.
  • Classify customer feedback into categories.

For this tutorial, we build a document assistant. The Prompt Builder tool can help structure the system prompt.

System Prompt You are a document assistant for [Company Name]. Your job is to answer questions using only the provided documents.

Rules:
- Only answer questions from the documents.
- If the answer is not in the documents, say so clearly.
- Always cite which document you found the answer in.
- Do not make up information.

Step 4: Add One Tool

Tools give your assistant the ability to take actions beyond generating text. For a document assistant, the most useful first tool is a search function.

Start with one tool. Each additional tool adds complexity. Get one working reliably before adding more. The AI Agents course covers multi-tool architectures.

Step 5: Log and Test

From the first version, log every interaction: input, reasoning, tool calls, and output. Build a test set of 20-30 questions with expected answers:

  • Happy path tests: Questions the assistant should answer correctly.
  • Boundary tests: Questions close to scope but not exactly covered.
  • Out-of-scope tests: Questions the assistant should decline.
  • Adversarial tests: Attempts to make the assistant ignore instructions.

Document Assistant Example

Here is a complete, minimal document assistant tying all steps together:

Complete Document Assistant from openai import OpenAI
import json

client = OpenAI()

# Simple document store
documents = {
  "pricing": "Basic $29/month. Pro $79/month. Enterprise custom.",
  "features": "Real-time analytics, team collaboration, API access.",
  "support": "Email (24h response) and live chat (business hours)."
}

# Define the search tool
tools = [{
  "type": "function",
  "name": "search_docs",
  "description": "Search company documents.",
  "parameters": {"type": "object", "properties": {"query": {"type":"string"}}, "required": ["query"]}
}]

This is a starting point, not a production system. The Vibe Coding course builds this into a full production application.

Frequently Asked Questions

Should I use the Assistants API or the Responses API?

The Responses API. The Assistants API is deprecated as of 2026. The Responses API is simpler, more flexible, and better supported.

What programming language should I use?

Python is the best-supported language for the OpenAI API. JavaScript/TypeScript is the second choice. Both have official SDKs.

How much does it cost to build and run an AI assistant?

Development and testing costs are minimal (typically under $5). Production costs depend on usage and model choice. GPT-5.5 Instant costs roughly $0.001-0.003 per request for simple tasks.

Want to Go Deeper?

This article is part of the Rupert Chesman AI Learning Hub. Explore structured courses, tools, and resources to build real AI fluency.

Explore Courses
RC

Written by Rupert Chesman

AI Educator · Filmmaker · Sydney

Rupert helps individuals and organisations master AI through practical, hands-on training. With experience across corporate workshops, online courses, and filmmaking, he bridges the gap between technical capability and real-world application.

Continue Reading

Free Weekly Insights

Get More AI Guides

Join 1000s of learners. Weekly tips, new articles, and practical frameworks. No spam, ever.

No spam. Unsubscribe anytime. Free cheat sheets on signup.