GPT (OpenAI)
GPT (Generative Pre-trained Transformer) is OpenAI's large language model
family; ChatGPT is the consumer/team chat product built on it. "GPT" is
also used generically in the industry for the transformer-based
autoregressive LLM architecture GPT popularized, distinct from OpenAI's
specific named models.
Two API shapes
OpenAI has two overlapping ways to call a model:
- Chat Completions API (
/v1/chat/completions) — the original,
widely-copied shape: a messages array of {role, content}, a model,
and completion parameters. Most third-party tools and "OpenAI-compatible"
APIs from other vendors mimic this shape specifically.
- Responses API (
/v1/responses) — OpenAI's newer, more agent-oriented
API: built-in support for multi-turn state via a previous_response_id,
built-in tools (web search, file search, code interpreter), and a unified
way to mix text/image/tool-call items in one response.
from openai import OpenAI
client = OpenAI()
# Chat Completions
resp = client.chat.completions.create(
model="gpt-4o", # verify current model id against docs
messages=[{"role": "user", "content": "Say hi in one word."}],
)
print(resp.choices[0].message.content)
# Responses API
resp = client.responses.create(
model="gpt-4o",
input="Say hi in one word.",
)
print(resp.output_text)
Function calling / tools and structured outputs
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
}]
resp = client.chat.completions.create(
model="gpt-4o", messages=[...], tools=tools,
)
- Function calling — declare a JSON-schema function; the model returns a
structured call for the caller to execute and feed the result back in a
follow-up message.
- Structured outputs (
response_format={"type": "json_schema", ...}) —
constrains the model's raw output to conform exactly to a given JSON
schema, rather than hoping a prompted "respond in JSON" instruction is
followed.
Model family shape
OpenAI ships multiple concurrent model lines that trade off capability,
latency, and cost (historically including a flagship multimodal line and
smaller/faster variants, plus separate reasoning-focused model lines).
Exact current model names, context windows, and pricing change frequently —
don't hard-code a specific id or number from training data into anything
user-facing; check OpenAI's model list.
Common pitfalls
- Assuming Chat Completions and Responses are interchangeable
drop-ins — they have different request/response shapes and different
built-in tool support; migrating between them is a real porting task, not
a rename.
- Treating "OpenAI-compatible API" (offered by many other vendors/local
runners) as guaranteeing full feature parity — most only implement a
subset of the Chat Completions shape (basic messages + streaming), not
every parameter or the Responses API.
- Hard-coding a model name in production code without a fallback plan —
OpenAI deprecates older models on a published schedule; watch for
deprecation notices rather than discovering it at a hard cutover.
- Confusing "GPT" the architecture family with "OpenAI's GPT models"
specifically — many other vendors' models (including open-weight ones)
are also GPT-style transformers; "GPT" alone doesn't imply OpenAI.
Learn more
1---2name: gpt-ai3description: Use when asked what OpenAI's GPT/ChatGPT is, how to call the OpenAI API (Chat Completions vs the Responses API), its function-calling and structured-output features, or how it compares to other model providers. Verify current model names/pricing against OpenAI's docs — this file covers stable shape, not a specific model generation's numbers.4metadata:5 source: https://skillmd.com/skills/skills-on-ai/gpt-ai6---78# GPT (OpenAI)910GPT (Generative Pre-trained Transformer) is OpenAI's large language model11family; **ChatGPT** is the consumer/team chat product built on it. "GPT" is12also used generically in the industry for the transformer-based13autoregressive LLM architecture GPT popularized, distinct from OpenAI's14specific named models.1516## Two API shapes1718OpenAI has two overlapping ways to call a model:1920- **Chat Completions API** (`/v1/chat/completions`) — the original,21 widely-copied shape: a `messages` array of `{role, content}`, a `model`,22 and completion parameters. Most third-party tools and "OpenAI-compatible"23 APIs from other vendors mimic this shape specifically.24- **Responses API** (`/v1/responses`) — OpenAI's newer, more agent-oriented25 API: built-in support for multi-turn state via a `previous_response_id`,26 built-in tools (web search, file search, code interpreter), and a unified27 way to mix text/image/tool-call items in one response.2829```python30from openai import OpenAI31client = OpenAI()3233# Chat Completions34resp = client.chat.completions.create(35 model="gpt-4o", # verify current model id against docs36 messages=[{"role": "user", "content": "Say hi in one word."}],37)38print(resp.choices[0].message.content)3940# Responses API41resp = client.responses.create(42 model="gpt-4o",43 input="Say hi in one word.",44)45print(resp.output_text)46```4748## Function calling / tools and structured outputs4950```python51tools = [{52 "type": "function",53 "function": {54 "name": "get_weather",55 "parameters": {56 "type": "object",57 "properties": {"city": {"type": "string"}},58 "required": ["city"],59 },60 },61}]62resp = client.chat.completions.create(63 model="gpt-4o", messages=[...], tools=tools,64)65```6667- **Function calling** — declare a JSON-schema function; the model returns a68 structured call for the caller to execute and feed the result back in a69 follow-up message.70- **Structured outputs** (`response_format={"type": "json_schema", ...}`) —71 constrains the model's raw output to conform exactly to a given JSON72 schema, rather than hoping a prompted "respond in JSON" instruction is73 followed.7475## Model family shape7677OpenAI ships multiple concurrent model lines that trade off capability,78latency, and cost (historically including a flagship multimodal line and79smaller/faster variants, plus separate reasoning-focused model lines).80Exact current model names, context windows, and pricing change frequently —81don't hard-code a specific id or number from training data into anything82user-facing; check OpenAI's model list.8384## Common pitfalls8586- **Assuming Chat Completions and Responses are interchangeable87 drop-ins** — they have different request/response shapes and different88 built-in tool support; migrating between them is a real porting task, not89 a rename.90- **Treating "OpenAI-compatible API" (offered by many other vendors/local91 runners) as guaranteeing full feature parity** — most only implement a92 subset of the Chat Completions shape (basic messages + streaming), not93 every parameter or the Responses API.94- **Hard-coding a model name in production code without a fallback plan** —95 OpenAI deprecates older models on a published schedule; watch for96 deprecation notices rather than discovering it at a hard cutover.97- **Confusing "GPT" the architecture family with "OpenAI's GPT models"98 specifically** — many other vendors' models (including open-weight ones)99 are also GPT-style transformers; "GPT" alone doesn't imply OpenAI.100101## Learn more102103- [OpenAI API docs](https://platform.openai.com/docs/)104- [OpenAI API reference](https://platform.openai.com/docs/api-reference)105- [Model deprecations](https://platform.openai.com/docs/deprecations)