What Is GPT? Models, Tokens, Context Windows, and Coding Use Cases
A practical explanation of GPT models, tokens, context windows, reasoning, hallucinations, API costs, and how GPT differs from ChatGPT and coding agents.

Start with the essentials
A practical explanation of GPT models, tokens, context windows, reasoning, hallucinations, API costs, and how GPT differs from ChatGPT and coding agents.

Start with the essentials
GPT means generative pre-trained transformer. It describes a family of language models trained to predict and generate sequences of tokens. A GPT model can write, summarize, classify, translate, reason over supplied context, generate code, and call tools when an application gives it those capabilities.
This guide explains the terms people most often search together: GPT models, ChatGPT, tokens, context windows, reasoning, API pricing, hallucinations, and coding agents. Product examples were checked against official OpenAI documentation on October 21, 2026.
A GPT model does not retrieve a memorized paragraph for every question. It calculates likely continuations from the prompt and its learned parameters. Applications can improve grounding by supplying files, search results, database records, or tool outputs.
| Term | What it is | Example use |
|---|---|---|
| GPT | A model family | Generate or analyze text and code through an API |
| ChatGPT | An application and service that uses OpenAI models | Conversation, research, writing, files, images, and tools |
| Codex | A coding-agent product and harness | Inspect repositories, edit files, run commands, and verify work |
| OpenAI API | A developer platform | Build GPT-powered features into software |
The model supplies intelligence; the application supplies the interface, tools, data access, memory, permission system, and workflow. Read our Codex guide for the coding-agent layer.
A token is a unit a model uses to process text. It may represent a character, punctuation mark, part of a word, or a whole common word. Tokenization varies by model and language. OpenAI gives a rough English estimate of four characters or three-quarters of a word per token, but exact counts require the target model's tokenizer.
| Token type | Meaning | Why it matters |
|---|---|---|
| Input tokens | Prompt, messages, files, tool definitions, and other supplied context | Count toward context and input cost |
| Cached input tokens | Reusable input recognized through prompt caching | Can cost less and reduce latency |
| Output tokens | Generated response and billed model output | Usually cost more than input |
| Reasoning tokens | Internal tokens used by reasoning models | Can count toward usage even when not shown |
A plain text word count does not capture message formatting, tools, schemas, images, or files. Inspect the API response's usage fields or use the full input-token counting endpoint when exact budgeting matters. See OpenAI's token counting guide.
The context window is the maximum number of tokens a model can work with in one request. It can include the input, output, and reasoning tokens. A large window can hold more documents or code, but size alone does not guarantee accuracy. Relevant, clearly structured context usually works better than a larger collection of noisy material.
Context window and knowledge cutoff are different. The context window controls how much information fits in the current request. The knowledge cutoff indicates the period covered by training data. Web search, retrieval, and supplied documents can provide newer information.
This probabilistic process explains both GPT's flexibility and its limitations. It can generate a fluent answer even when the underlying claim is wrong.
A hallucination is a plausible-looking statement unsupported by reliable evidence. It can happen when the prompt is ambiguous, the requested fact is missing from context, the model overgeneralizes patterns, or the application does not verify tool results.
OpenAI prices models per million input, cached-input, and output tokens, with separate charges for some tools and compute. Rates differ greatly between flagship, balanced, and high-volume models. Always use the current API pricing page.
The basic text-cost formula is:
(input tokens ÷ 1,000,000 × input rate) + (cached tokens ÷ 1,000,000 × cached rate) + (output tokens ÷ 1,000,000 × output rate)
If a model costs $2 per million input tokens and $10 per million output tokens, 50,000 input tokens plus 5,000 output tokens costs about $0.15: $0.10 input and $0.05 output. Add any reasoning, tool, search, image, audio, or container charges that apply.
Model selection should follow an evaluation set, not a leaderboard alone. Collect representative inputs, define correct outputs, measure error rate, latency, and total task cost, then choose the least expensive model that meets the requirement.
A plain GPT prompt can explain a function or draft a snippet. An AI coding agent adds repository access, tools, command execution, diff review, and multi-step control. Compare GitHub Copilot, Cursor, Claude Code, Codex, and Gemini Code Assist in our AI coding tools guide.
No. Artificial intelligence is a broad field. GPT is one family of generative language models within that field.
No. GPT refers to models; ChatGPT is an application that uses OpenAI models and adds an interface, tools, account features, and product workflows.
A rough English estimate is about 750 words, but language, punctuation, code, spacing, and model encoding change the exact count.
It lets the model consider more material, but irrelevant or conflicting context can still reduce quality. Retrieval, organization, instructions, and verification remain important.
Training has a cutoff. Current answers require web search, retrieval, or documents supplied at request time, followed by source verification.
Prepared with AI assistance and reviewed against the sources cited in the article. Product details may change after publication.
Explore related topics
Software Engineer with 5+ years of experience specializing in scalable web systems, modern full-stack architecture, and technical research.
Continue reading
Artificial IntelligenceLearn Claude Code setup, model choices, context management, subscription versus API billing, token costs, and practical ways to reduce usage safely.
Artificial IntelligenceUnderstand Cursor plans, model context windows, token-based usage, Agent workflows, privacy controls, and how to estimate the cost of real coding tasks.
Artificial IntelligenceLearn how GitHub Copilot agents work, compare current plans and AI credits, understand token-based usage, and follow a practical setup and evaluation workflow.