What Is the OpenAI API? A Plain-English Guide for Beginners (2026)
What an API is, how it differs from ChatGPT, how the pay-per-use billing works and what to check before you start

If you have searched for "what is the OpenAI API", you probably saw the term in a tutorial, an app description or a job advert and wondered whether it is something you need. This guide explains it in plain English: what an API is, what the OpenAI API does, how it differs from ChatGPT, how the billing works, and what to do if you only want to try it. Everything here comes from OpenAI's own documentation and help pages, and we say clearly what we could not confirm.
Video: Balance accuracy, latency, and cost, an OpenAI DevDay talk listed on OpenAI's developer video page. It is longer and more technical than this guide, so it is best for readers who want to go deeper into cost. AmonFun is not affiliated with OpenAI.
What an API is, in one minute
API stands for application programming interface. Think of a restaurant: you do not walk into the kitchen, you give your order to a waiter and the dish comes back. An API is the waiter between two programs. One program sends a request in an agreed format, and the other program sends back a result.
What the OpenAI API does
OpenAI's quickstart describes it as a consistent interface to its AI models, for tasks such as generating text, language processing and computer vision. In practice, a developer writes a few lines of code that send a prompt to a model and receive the reply, and then puts that reply inside an app, a website, a chatbot or an automation.
OpenAI provides official libraries, called SDKs, for JavaScript and TypeScript, Python, .NET, Java, Go and Ruby, and you can also send raw web requests. That is why most guides about the API are written for people who can code.
ChatGPT vs the API: the difference
| Point | ChatGPT | OpenAI API |
|---|---|---|
| What it is | An app you chat with in a browser or phone app | A connection that lets other software use the models |
| Who uses it | Anyone | Mostly developers, or people using tools that need a key |
| How you pay | A free plan, or a monthly plan | Prepaid credits used up as you go |
| Where you use it | In the ChatGPT app | Inside your own code, app or automation |
An unofficial community FAQ says that API billing is tied to an organisation account and is separate from ChatGPT, and that you can sign in with a ChatGPT login but the billing stays separate. We could not open OpenAI's own help page on this point, so treat it as a strong hint and check your account.
How the billing works
OpenAI's billing help page says that the API uses prepaid billing: you buy credits first and your balance goes down as you use the API. These are the points it gives:
- Minimum purchase: $5, with $10 as the default amount.
- Expiry: purchased credits expire after one year, and the page says OpenAI cannot extend that date.
- Refunds: credits are generally not refundable, with exceptions such as confirmed billing errors or unauthorised activity.
- Free credits: if an account has any, they are used before purchased credits. The page does not describe a free trial programme.
- Limits: a positive balance does not guarantee a request will go through, because rate limits and spend limits are separate.
- Auto-recharge: optional, and you can set a monthly cap.
What a token is
The API is priced by tokens, which are small pieces of text that the model reads and writes. Both your prompt and the answer count. OpenAI's pricing page lists text prices per 1 million tokens, with one price for input and one for output. Our plain English glossary of AI words explains tokens and other terms.
Example prices from the pricing page
| Model | Input per 1M tokens | Output per 1M tokens |
|---|---|---|
| gpt-5-nano (small) | $0.05 | $0.40 |
| gpt-5-mini (medium) | $0.25 | $2.00 |
| gpt-6.2-astra (flagship) | $8.00 | $40.00 |
These are standard short-context prices on the day we read the page, 30 November 2026. They change often, so check the page before you plan anything. The page also lists Batch prices at roughly half of Standard for some models, and says the moderation model is free.
Is the OpenAI API free?
Not in the way a free ChatGPT plan is. The quickstart says that your first test request is free, and that adding credits gives you higher limits. The billing page mentions free credits only as something an account may have. We found no official page that promises free credits to every new account, so do not count on them. Several websites claim exact free amounts, and we did not repeat them because we could not verify them.
If you only want to learn AI for free, a normal chatbot is simpler. Our comparison of the free plans of ChatGPT, Gemini and Claude shows what each one offers without any code.
How people get started
According to OpenAI's quickstart, the steps are:
- Create an API key in the dashboard.
- Save the key as an environment variable on your computer, so the libraries can find it.
- Install the library for your language.
- Send a first request and read the reply.
Keep your API key private
An API key works like a password that spends your money. The quickstart says to store it in a safe place. We could not open OpenAI's dedicated key safety page, so the rest of this list is our general advice, not a quote:
- Never paste your key in a public place, a screenshot, a chat or a public code repository.
- Do not put it in code that runs in a web page, because visitors can read it.
- If you think it has leaked, delete it in the dashboard and create a new one.
- Set a spending limit or keep a small balance while you are learning. Our guide on protecting your privacy with free AI tools has more habits like this.
Common mistakes to avoid
- Thinking a ChatGPT subscription includes the API. The two are billed separately according to the community FAQ, so check your own account.
- Paying a stranger for a key. Sellers of cheap keys or shared accounts are a risk. Create your own key on OpenAI's site.
- Trusting a screenshot of prices. Prices change, so read the official page.
- Leaving auto-recharge on without a cap. Set a monthly limit.
- Expecting instant access. The community FAQ says that some models need identity verification and that a new account starts with low limits.
Quick questions
Do I need the API to use ChatGPT?
No. ChatGPT is an app you use directly. The API is for building or connecting software.
Can I use the API without coding?
Some no-code tools let you paste an API key, but you are still responsible for the key and the cost. Learn the basics first.
Why did I get an error about my plan and billing?
The community FAQ says a request made before the account is funded can return a 429 error that mentions your plan and billing. Check the billing page in your dashboard.
What we could not confirm
- OpenAI's page on ChatGPT billing versus API billing. We could not open it, so that comparison relies on an unofficial FAQ.
- OpenAI's key safety page. We could not open it, so the safety list is our own advice.
- Free credits for new accounts. No official page promises them.
- Current prices and model names. They were correct on the day we read the pages and may change.
- Country differences. Availability, taxes and payment methods can vary by country.