Guide

How to use the ChatGPT API: what it is, how to get access, and a first call

Prices checked Nov 26, 2026 · 4 min read

How to use the ChatGPT API: a request and a reply drawn as two cards on a dark desk

To use the ChatGPT API, create an OpenAI API key, add prepaid credits, install an SDK and send a request with a model name and a message. The "ChatGPT API" is a common name for the OpenAI API: you send text from your own code and pay per token. This guide explains what it is, how access works, what a call costs, and a first request.

What is the OpenAI API?

The OpenAI API is how your software talks to OpenAI models. Your code sends input, such as a question or a document, along with the name of a model. The model sends text back. You are billed by tokens, which are small pieces of text: a short English word is often one token, though the count depends on the model's tokenizer.

It is not the same product as the ChatGPT app. OpenAI's help page says ChatGPT and the API platform have separate billing systems, and API usage is billed separately from a ChatGPT subscription. So paying for ChatGPT does not give you API calls. The same page says eligible subscriptions may come with promotional API credits for a linked API organization, without saying which ones.

How to get OpenAI API access

  1. Create a key. In the OpenAI dashboard, go to platform.openai.com/api-keys. Our key guide covers storage and safety.
  2. Add credits. OpenAI's prepaid billing page gives a $5 minimum first purchase, with $10 as the default. Purchased credits expire after one year. See OpenAI credits for refunds and auto-recharge.
  3. Know your tier. OpenAI's rate limits page says your usage tier rises as total credit purchases reach $5 (Build), $100 (Launch) and $500 (Grow). Having a tier does not guarantee access to every model.
  4. Send a request. With the Python SDK, the quickstart call is client.responses.create(model="gpt-6.2-astra", input="...") after pip install openai and exporting OPENAI_API_KEY. The Python guide walks through it.

Authentication uses HTTP Bearer in the Authorization header. The SDK handles that for you.

Choose the model by cost

Pick the smaller model first and move up only if answers are not good enough. These are OpenAI's listed standard prices from its pricing page, per 1M tokens, next to the TapModels catalog prices.

ModelOpenAI input / outputTapModels input / output
GPT-6.2 Sol$2.00 / $10.00$0.60 / $3.00
GPT-6.2 Astra$8.00 / $40.00$2.40 / $12.00

Worked example. A chatbot answers 500 questions a day. Each uses 1,200 input tokens, with the history, and 350 output tokens. That is 600,000 input and 175,000 output tokens a day, or 18M input and 5.25M output in a 30-day month.

  • GPT-6.2 Sol at OpenAI's rates: 18 x $2.00 = $36.00, plus 5.25 x $10.00 = $52.50. Total $88.50.
  • GPT-6.2 Sol at TapModels rates: 18 x $0.60 = $10.80, plus 5.25 x $3.00 = $15.75. Total $26.55.
  • GPT-6.2 Astra at OpenAI's rates: 18 x $8.00 = $144.00, plus 5.25 x $40.00 = $210.00. Total $354.00.

Move that bot to Astra and the bill is four times higher before you have changed anything else. Check the real token counts in each response's usage field, and use the LLM cost calculator to test your own numbers.

A first call through an OpenAI-compatible key

If you prefer one key for several vendors, a compatible endpoint takes the same request shape. TapModels is a separate service from OpenAI: we do not issue OpenAI keys, and our key works on our endpoint only. The contract lists POST /v1/chat/completions as OpenAI-compatible.

curl https://api.tapmodels.com/v1/chat/completions \
  -H "Authorization: Bearer $TAPMODELS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6-2-sol",
    "messages": [{"role": "user", "content": "Explain a webhook in two sentences."}],
    "max_tokens": 200
  }'

You get a standard chat completion back, billed per token from your prepaid credits. New accounts start at 0 credits, so add some first; a call without enough balance returns 402 insufficient_credits. Cap max_tokens while you test, because output tokens cost five times as much as input tokens on this model.

Common first mistakes

  • Using a ChatGPT login as a key. They are different systems.
  • No balance. A key with zero credits cannot make paid calls.
  • Putting the key in a browser or mobile app. OpenAI says to keep keys server-side.
  • Sending the whole chat history every turn without trimming. Input tokens grow with each message, and you pay for all of them each time.
  • Ignoring limits. A burst of requests can return a 429. Read the rate limit guide before you launch.

If you need OpenAI's own invoices or data terms, stay with OpenAI. If you want several vendors on one balance, read how to judge a third-party provider first. Next step: browse the chat models and prices on the LLM API page.

Frequently asked questions

What is the OpenAI API?

It is the interface that lets your own code send text, and other inputs, to OpenAI models and get answers back. You authenticate with an API key, send requests over HTTP or an SDK, and pay per token. It is a developer product, separate from the ChatGPT app and its subscriptions.

Is the ChatGPT API free with a ChatGPT subscription?

No. OpenAI says ChatGPT and the API platform have separate billing systems, and API usage is billed separately from your ChatGPT subscription. OpenAI adds that eligible subscriptions may come with promotional API credits for a linked API organization. Check your API billing page to see if you have any.

How do I get ChatGPT API access?

Create an API key in the OpenAI dashboard at platform.openai.com/api-keys, then add prepaid credits on the billing page. OpenAI's help page gives a $5 minimum first purchase. Your usage tier, and so your rate limits, rises as total credit purchases reach $5, $100 and $500.

How much does one ChatGPT API call cost?

It depends on tokens. On GPT-6.2 Sol, OpenAI lists $2.00 per 1M input tokens and $10.00 per 1M output tokens. A call with 1,000 tokens in and 300 out costs about $0.005 at those rates, or $0.0015 at TapModels catalog rates of $0.60 and $3.00.

Can I use the ChatGPT API without OpenAI?

You can send OpenAI-format chat requests to another provider that supports the format. TapModels lists POST /v1/chat/completions as OpenAI-compatible. You use a TapModels key and the base URL api.tapmodels.com/v1. It is a separate service, not a way to access OpenAI's own account features.

Sources