OpenAI API Integration – Python Smoke Test

What it does

This project demonstrates secure, production-style usage of the OpenAI API in Python using an environment variable–based API key and the OpenAI Responses API. It includes a minimal pass/fail smoke test plus a small summarization example to show how validated API access extends into application logic.

Best use cases

  • Verifying authenticated OpenAI API access in a new environment
  • Establishing secure key handling patterns (environment variables / .env)
  • Providing a clean baseline repo for future AI features (tools, agents, tutoring workflows, etc.)

What’s included

1) API connectivity smoke test (smoke_test.py)

  • Confirms OPENAI_API_KEY is present
  • Sends a minimal request to the Responses API
  • Returns a clean success signal (or fails fast)

2) Example summarization script (summarize.py)

  • Runs a simple “3 bullet points” summarization task
  • Demonstrates response parsing and output handling
  • Uses the same authenticated client configuration

Security / hygiene

  • API keys are not committed to source control
  • .env and .venv/ are ignored via .gitignore
  • Dependencies are explicitly listed in requirements.txt

How to run

Setup

```bash python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt