AI Token King Logo AI Token King
Get Started

How to use ChatGPT API? Basic tutorial for newbies to learn the OpenAI API for the first time

How to use the ChatGPT API is the first question many people search for when they want to integrate AI into websites, apps, customer service processes or automation tools for the first time. Just want to make one thing clear first: in spoken language, everyone will say ChatGPT API, but the official

May 22, 2026

How to use ChatGPT API? Basic tutorial for newbies to learn the OpenAI API for the first time

How to use the ChatGPT API is the first question many people search for when they want to integrate AI into websites, apps, customer service processes or automation tools for the first time. Just want to make one thing clear first: in spoken language, everyone will say ChatGPT API, but the official main line for newbies is actually OpenAI API, and the main recommended text generation interface is Responses API; at the same time, Chat Completions API still exists, suitable for conversational requests that are more familiar with the messages structure.

OpenAI official Developer quickstart currently teaches how to create an API Key, install the SDK, and run the first API call. The official API Reference also clearly positions Responses as the most advanced response interface.

If you just want to grasp the most important difference now, you can remember this sentence first: ChatGPT is a chat tool for people to use directly, and OpenAI API is for your website, app, backend, customer service process or automated system access model. And the two are billed separately. OpenAI Help Center clearly states that the ChatGPT platform and API platform are two separate platforms; ChatGPT Plus also clearly states that "API usage is separate and billed independently".

This article will not throw you into a bunch of abstract terms, but directly answer the few things that novices care about most: how to start the OpenAI API, how to run the first request, how to place the API key, what are the basic numbers for the cost of AI Token, and what are the pitfalls you are most likely to step into.

First understand: what exactly do you want to use

If you now want your product or process to call the model, for example:

Then what you need to look at is the path of "using the OpenAI API to access the model" instead of just staying at the chat interface. OpenAI's official quickstart and Responses API documents are very clear: you call the model to respond through the API key, rather than manually chatting in the ChatGPT interface.

Before starting from scratch, you must prepare 4 things first

1. OpenAI account and API platform

Developer quickstart directly states that the first step is to create an API key and execute the first API call.

2. API Key

OpenAI officially recommends placing the key in the environment variable OPENAI_API_KEY instead of hard-writing it in the program. The Help Center's API key security guide also clearly states that you should not deploy keys in client-side environments such as browsers or mobile apps, and do not submit keys to code repositories.

3. API billing settings

OpenAI Help Center clearly states that API services and ChatGPT subscriptions are managed separately; if you want to start using the API, you can set the payment method on the billing page of the API platform. If you want to go prepaid, the Help Center also states that you can buy prepaid credits first, and the minimum initial purchase amount is currently $5.

4. Project management

If you are not just playing around with it yourself, but want to formally work on a project, it is best to use project management from the beginning. OpenAI's official Projects document clearly states that projects can be divided into roles, track usage, set budgets, and can limit model usage and rate limits.

The most suitable way for newbies to start now: Responses API

OpenAI official API Reference positions Responses as the most advanced model response interface, supporting text and image input, text output, and built-in tools such as file search, web search, computer use, and function calling. For novices, the advantage of this line is that it will be more scalable in the future. It will be relatively smooth from simple text Q&A to tool calls and multi-step processes.

If you just want to do the most basic text Q&A, the Responses API is enough. If you are already familiar with the old messages structure, Chat Completions are still available; but if you are starting from scratch today, learning the Responses API first will be more in line with the official current main line.

The first minimum runnable example, how to understand it

The novice example given by OpenAI official quickstart is very straightforward.

JavaScript

Install the openai package, create client = new OpenAI(), and then call:

client.responses.create({ model: "gpt-5.2", input: "..." })

Then read response.output_text.

The same idea: first pip install openai, then from openai import OpenAI, create client = OpenAI(), then call client.responses.create(...), and finally print out response.output_text.

For novices, the most important thing is not to understand the entire returned JSON at once, but to know first: response.output_text can be used as the text answer that the model finally returns to you.

What result will you get? Just look at response.output_text first

For newbies, don’t be intimidated by the entire JSON response at first. OpenAI official quickstart uses response.output_text as the most direct output field.

This means that you can first understand it as:

You throw it into input

The model generates answers for you

You read response.output_text first

It will be more natural to study the complete return structure after you have to do streaming, tool calling, and structured output.

Which model should I use? Novices should not think about the most complicated ones at the beginning

OpenAI’s official pricing page currently clearly distinguishes GPT-5.5, GPT-5.4, and GPT-5.4 mini. There is also price information for GPT-5.4 nano. The pricing page shows that the price of GPT-5.4 is input $2.50 / 1M tokens, output $15.00 / 1M tokens; GPT-5.4 mini is input $0.75, output $4.50; GPT-5.4 nano is input $0.20, output $1.25. OpenAI also stated in the GPT-5.4 mini/nano release article that nano is more suitable for simpler supporting tasks such as classification, data extraction, and ranking.

For novices, the easiest way to make mistakes is usually:

Use the official quickstart process to run through the API first

Then come back to compare the high-end model, mini, nano, which one is more suitable for your task

When you really need high-quality professional output, go up to the model level

What do you think of the basic cost of the ChatGPT API? It’s enough to look at the three fields of AI Token first

OpenAI’s official pricing page clearly breaks down the price into three main fields:

Cached input

This means that you can’t just look at the number “per million Tokens”. The really useful starting concept is:

Input is the content cost you send to the model

Output is the content cost the model returns to you

Cached input is the lower cost after you repeat the prefix or background hit cache

In other words, AI Token does not only have the total amount, but depends on which period it is spent. Many novices will initially think that they only asked one sentence and the cost should not be high. However, if the system prompt is very long, there are many historical dialogues, and the model returns are very long, the usage of AI Token will actually increase faster than intuition. OpenAI's official token and pricing documents are originally split along this logic.

The 5 most common pitfalls for newbies

1. Thinking that ChatGPT Plus already contains API

No. OpenAI officially states that ChatGPT and API are separate platforms, and billing is managed separately; Plus also clearly states that API usage is separate and billed independently.

2. Put the API key directly on the front end

OpenAI’s official security advice is very clear: do not put the key in the browser or mobile app; requests should go through your own back-end server.

3. Do not set up project and budget at the beginning

If you already know that this is not a single-person test, but a formal project, directly using project to manage keys, roles, model usage and budget will be much cleaner than squeezing them all into the default project.

4. Only focus on the lowest price model from the beginning

Cheap doesn't mean suitable. OpenAI's model and price stratification inherently shows that different models correspond to different work intensities. It is usually more stable to run the process through first and then optimize costs.

5. Start from scratch but only learn the old Chat Completions

Chat Completions can still be used, of course, but the official main line of OpenAI for novices now is obviously the Responses API. Today we are going to start from scratch. Learning the Responses API first will be more in line with the development of subsequent tools and multi-modal capabilities.

The shortest path for newbies

If what you want now is the most time-saving entry sequence, you can just do this:

  • Create an OpenAI account and enter the API platform
  • Create a set of API keys and put them in the OPENAI_API_KEY environment variable
  • Add a payment method to API billing, and add small pre-credits if necessary
  • Use the official quickstart JavaScript or Python example to run through the first one responses.create
  • After you can get response.output_text, then look back at the model, AI Token, price and project management

The advantage of this route is: you can make it "runable" first, and then study the cost and structure in depth, and you will not be stuck with too many nouns at the beginning. This is also the spirit of OpenAI’s official quickstart.

The so-called "ChatGPT API" can be understood as: using the OpenAI API to let your product or process call the chat model.

For today’s novices, the best way to get started is usually:

Learn the Responses API first

Run through the first request first

Then look at the model, AI Token cost, price and project management

As long as you clearly distinguish between the "chat tool" and the "API platform", the subsequent learning curve will be much smoother. This is also the direction in which your original manuscript is most worth retaining.

FAQ: 6 most frequently asked questions by newbies

Is ChatGPT API the official product name?

Many people will call it this, but the official newbie mainline is now OpenAI API, and the main entrance for text generation is Responses API; Chat Completions is still available.

I subscribed to ChatGPT Plus, do I need to pay additional API fees?

Required. OpenAI officially states that ChatGPT Plus does not include API usage, and the API needs to be billed independently.

A novice’s first API request, which interface is the official recommendation to use now?

Both the official quickstart and API Reference regard the Responses API as the main starting interface.

Can the API key be placed directly on the front-end website?

No. OpenAI officially recommends not to deploy keys in browsers or mobile apps, and requests should go through your own backend.

Should newbies study projects and budgets from the beginning?

If you are just testing by yourself, you can run through the API first; but if you are already planning to use it in a formal project or team, OpenAI's official project, roles, budgets, and model usage limits are worth using early.

How much is the minimum initial preparation for OpenAI API?

If you want to go with prepaid billing, the OpenAI Help Center currently writes that the minimum initial purchase amount is $5.

Data source and credibility statement

This article is written based on OpenAI official developer documents and official Help Center, focusing on official sources such as OpenAI Developer Quickstart, Responses API Reference, OpenAI API Pricing, Billing settings in ChatGPT vs Platform, What is ChatGPT Plus?, How can I set up prepaid billing?, Best practices for API key safety, Managing projects in the API platform. The content is organized in a three-layered manner of "official starting route × official billing structure × novice implementation sequence". The focus is not on stacking jargon, but on helping you really get your first API up and running.

If you want to return to the main battle page of AI platforms, tools and procurement, you can read this article first: How to choose an AI Token platform? Newbies should first distinguish between original factory, aggregation and agency.

This article belongs to the "AI Platform, Tools and Procurement" category

This category mainly organizes AI platform roles, tool uses, API access methods, platform selection and procurement judgments. The content focuses on topics such as original APIs, aggregation platforms, multi-model platforms, differences between tools and platforms, import sequence, budget and permission management. It helps novices, small and medium-sized teams and enterprises to quickly distinguish what to use first, when to upgrade, and what problems the platform is solving when faced with AI import.

What is the AI ​​API platform? What's the difference between using a chat tool directly?

AI Token Tutorial for Lazy People: Learn from getting started, calculating to cost saving at once

What do you think about the price of AI Token? Newbies should first understand where the fees come from

How does AI Token reduce fees? Don’t just switch to cheaper models

  • AI Token
  • ChatGPT API
  • OpenAI API
  • Responses API

AI Token organizes the basic concepts, calculation methods, API fees and model comparisons of AI Token (word elements), and covers common models such as ChatGPT, Gemini, Claude, etc. to help you establish clear understanding and judgment faster.

Function
Model comparison
Usage context
AI Token Calculator

Learn
Getting Started
Article area

Other information
About us
Privacy Policy

© 2026 AI Token. All rights reserved.

Share: X / Twitter LinkedIn
Back to Blog