Writing

Tutorials · November 1, 2026

How to Use OpenAI API Free Credits for Class

Learn how teachers can use OpenAI API free credits to build custom quiz generators and rubric assistants without spending extra money from school budgets.

Teachers spend hours writing quizzes, drafting rubrics, and tailoring feedback. Commercial ed-tech platforms promise to automate this work, but they often charge subscription fees that drain limited classroom budgets. A recent r/OpenAI thread titled “How are you using the free API credits?” highlights a growing interest in building custom tools instead of buying them. If you have an eligible ChatGPT subscription, you may have access to OpenAI API free credits that let you prototype and run your own classroom applications at no extra cost. According to the OpenAI Help Center article on API credits benefits for eligible ChatGPT subscriptions, these credits are suited for text-based educational tools like quiz generators and rubric assistants.

Note that the free trial credits available for new accounts (documented in the Quickstart) and the API credits benefit for eligible ChatGPT subscriptions (documented in the Help Center) are separate programs with their own terms and rules. Check the official documentation for the specific program that applies to you.

This tutorial walks you through claiming those credits, setting up your environment, and running a simple script to generate classroom materials. You do not need to be a software engineer to follow along.

Lines of code on a laptop screen in a classroom

What you need

Before you start building, gather the following items:

  • An active ChatGPT subscription that qualifies for the API credits benefit, or a new account eligible for free trial credits. Check the official OpenAI Help Center documentation to confirm your eligibility and verify which specific controls apply to your account, as interface details may update over time.
  • A computer with Python installed. The OpenAI API Documentation Quickstart recommends setting up a local development environment to send your first request.
  • A terminal or command prompt application.
  • A code editor, such as VS Code, or even a basic text editor like Notepad.
  • Your OpenAI API key, which you will generate in the steps below.

How to claim OpenAI API free credits

Follow these steps to set up your environment and apply your OpenAI API free credits toward a working classroom tool. These instructions are drawn directly from the OpenAI API Documentation Quickstart and the OpenAI Help Center.

  1. Verify your credit availability. Log into your OpenAI account. Confirm that your eligible ChatGPT subscription has applied the API credits benefit, or that your new account has received free trial credits. The OpenAI Help Center notes that these credits come with specific usage rules and expiration terms, so check the official help resources to view your balance before you begin building.
  2. Create your API key. Follow the OpenAI API Documentation Quickstart to create an API key. Copy it immediately and store it somewhere secure, like a password manager.
  3. Set up your development environment. The Quickstart guide documents how to set up a development environment. Check the official Quickstart documentation for the current recommended steps to organize your project files.
  4. Install the required library. The Quickstart guide documents how to install the necessary packages to communicate with the API. Refer to the official documentation for the exact installation commands.
  5. Configure your API key safely. Instead of pasting your key directly into your code, the Quickstart documentation recommends setting it as an environment variable. Check the official Quickstart guide for the specific commands required by your operating system to prevent accidentally sharing your key if you distribute your script to other teachers.
  6. Write your script. Open your code editor and create a file for your project. You will write a short Python script that sends a prompt to the API and prints the response. The Quickstart documents how to send your first API request to build custom applications such as quiz generators or rubric assistants.
  7. Run the script. Save the file and execute it according to the steps in the Quickstart guide. The API will process your request, and the generated output will appear in your terminal.

Where this goes wrong

Even with straightforward setup steps, a few common issues can stall your progress.

First, watch out for credit expiration. The OpenAI Help Center FAQ on free trial credits explains that promotional and subscription-linked credits expire after a set period. If you wait until the end of the semester to test your tools, your balance might already be zero. Build and test early.

Second, never hardcode your API key into your script. If you email a Python file containing your raw key to a colleague, anyone who opens it can use your credits. Always use environment variables as outlined in the Quickstart guide.

Third, keep your prompts focused. Broad requests like "make a test about history" consume more tokens and yield poor results. Specific prompts save credits and produce better classroom materials.

Worked Example: 5th Grade Science Quiz Generator

The OpenAI API Documentation Quickstart documents how to send your first API request to build custom applications such as quiz generators. To implement a 5th grade science quiz generator, refer to the Quickstart guide for the supported Python code structure, including the correct model names and parameters. You can adapt the documented example to build a rubric assistant by changing the prompt to ask for grading criteria based on a specific assignment description.

By handling the API calls yourself, you bypass expensive third-party software and retain complete control over the data you send. Just remember to monitor your usage regularly so you know exactly how much of your allocation remains for the rest of the school year. Check the official OpenAI help resources for guidance on viewing your remaining balance.

Sources