LevelUpWith

Explore / AI & Agents

Building with the OpenAI API: From Key to Production

Illustrated cover for the course “Building with the OpenAI API: From Key to Production”

Go from your first API key to a small deployed service. You'll choose models, use the Responses API, get structured outputs, call functions, add built-in tools and search over your own documents, stream responses, work with images and audio, test your outputs, control cost and rate limits, and run i

Capable · 20 levels · 2 free · Created Oct 2026 · Professionally curated by levelupwith.com

What's inside

  1. Level 1: Platform, Projects and Keeping API Keys Out of CodeFree
    Set up an OpenAI platform account, organization and project, create a project-scoped API key, load it from an environment variable or secrets file kept out of your repository, and make your first verified call. This course is independent of OpenAI and not endorsed by it.
  2. Level 2: Choosing a Model: Quality, Speed and CostFree
    Read OpenAI's current model list and pricing page to pick a model by quality, latency, context window and price per million tokens, and test the choice on your own prompts instead of trusting leaderboards.
  3. Level 3: The Responses API and How It Relates to Chat Completions
    Understand the Responses API's input items and output items, compare a call with the equivalent Chat Completions request, and know where the retired Assistants API's concepts went.
  4. Level 4: Instructions and Conversation State
    Steer the model with instructions and role-based messages, then carry a multi-turn conversation by resending history yourself, chaining previous_response_id or using the Conversations API, with the trade-offs of each.
  5. Level 5: Structured Outputs with JSON Schemas
    Make the model return JSON that matches a JSON Schema you define, using strict structured outputs with Pydantic or Zod, and handle refusals and schema limitations.
  6. Level 6: Function Calling: Connecting the Model to Your Code
    Describe your own functions as tools, let the model decide when to call them, run the calls in your code, and send results back so the model can finish its answer.
  7. Level 7: Built-in Tools: Web Search and Code Interpreter
    Turn on OpenAI's hosted web search and code interpreter tools in a Responses call, read their citations and outputs, and weigh their extra cost and latency against building the same thing yourself.
  8. Level 8: Retrieval over Your Documents: Files and Vector Stores
    Upload your own documents, index them in a vector store, and see how chunking, embeddings and attributes decide what can be retrieved later.
  9. Level 9: File Search and Grounded Answers
    Connect a vector store to the file search tool so answers come from your own documents with file citations, and tune and test retrieval quality.
  10. Level 10: Streaming Responses to Users
    Stream responses as server-sent events and handle the typed event stream, including text deltas, tool-call events, completion and errors, so users see output as it arrives.
  11. Level 11: Images and Vision
    Send images to a model for vision tasks, and generate or edit images with OpenAI's image generation, checking current model names, sizes and per-image prices.
  12. Level 12: Audio: Speech-to-Text, Text-to-Speech and Realtime in Outline
    Transcribe audio, generate speech, and see where the Realtime API fits for low-latency voice apps, while checking which audio models and features are current or in beta.
  13. Level 13: The Agents SDK: Agents, Tools and Handoffs in Outline
    Use OpenAI's Agents SDK in Python or TypeScript to define agents with instructions and tools, run the agent loop, hand off between specialist agents, and inspect traces.
  14. Level 14: Evaluating Outputs and Regression Tests
    Turn good behaviour into tests: build a labelled dataset, score outputs with code checks and model graders, and run the suite on every prompt or model change.
  15. Level 15: Cost Control: Tokens, Prompt Caching and the Batch API
    Measure and cut spend by counting tokens, setting output limits, structuring prompts to benefit from automatic prompt caching, and moving offline work to the Batch API.
  16. Level 16: Rate Limits, Retries and Error Handling
    Understand request and token rate limits and usage tiers, read rate-limit headers, and handle 429s, timeouts and server errors with backoff, idempotency and fallbacks.
  17. Level 17: Safety: Moderation and Prompt Injection Defence
    Screen inputs and outputs with the moderation endpoint, and defend tool-using and retrieval apps against direct and indirect prompt injection with layered, least-privilege design.
  18. Level 18: Data Controls, Retention and Privacy
    Understand what OpenAI stores and for how long, including stored responses, files, vector stores and logs, and set up your project's data controls, retention and deletion to match your privacy obligations.
  19. Level 19: Deploying a Small Service and Comparing Providers
    Wrap your OpenAI calls in a small FastAPI or Express service with secrets management, logging, health checks and cost guards, deploy it, and briefly compare OpenAI's API with other providers'.
  20. Level 20: Final Challenge: Build, Test and Ship a Complete App Exam
    Build, evaluate and deploy a document-grounded assistant that uses structured outputs, function calling, file search, streaming, cost and rate-limit controls and safety measures, then review the whole course.

Access

The first 2 levels are free with a free account. Every level, the podcast edition and the AI tutor come with All Access at £4.99/month or any Creator plan — see pricing.

Start free →