OpenAI
OpenAI
The developer of the GPT series. ChatGPT, DALL-E, Whisper. A leader in AI research.
OpenAI
The developer of the GPT series. ChatGPT, DALL-E, Whisper. A leader in AI research.
OpenAI is a U.S. AI company leading the research and deployment of artificial intelligence. It is defining the direction of the AI industry by developing innovative AI products such as the GPT series (GPT-3, GPT-4, GPT-5), ChatGPT, DALL-E (image generation), Whisper (speech recognition), and Codex (code generation).
It was founded in 2015 as a nonprofit research institute by Elon Musk, Sam Altman, and others, but converted to a for-profit entity (capped-profit) in 2019. In 2023, ChatGPT surpassed 100 million users faster than any product before it, leading the popularization of AI, and with large-scale investment from Microsoft, it is currently valued at approximately $150B.
As of 2025, the latest models are the GPT-5 series. GPT-5 reduced hallucinations by 45-80% compared to previous models and records top performance of 94.6% on AIME 2025 and 74.9% on SWE-bench. GPT-5.2 Thinking performs expert-level work, and reasoning models such as o3/o4-mini are specialized for complex reasoning tasks. In June 2025, o3-pro was made available to Pro users.
In practice, the OpenAI API is used for almost all AI applications, including chatbots, document processing, code generation, and image analysis. gpt-4o-mini is suited to cost-efficient general tasks, gpt-4o to complex analysis, and o1/o3 to math, coding, and reasoning. Pricing is $0.15-$15 per 1M input tokens, varying greatly by model.
# OpenAI API 사용 예제
# pip install openai
from openai import OpenAI
client = OpenAI() # OPENAI_API_KEY 환경변수 사용
# ===== 1. 기본 채팅 완성 =====
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{"role": "system", "content": "당신은 유능한 AI 어시스턴트입니다."},
{"role": "user", "content": "파이썬 데코레이터를 설명해주세요."}
],
max_tokens=1000,
temperature=0.7
)
print(response.choices[0].message.content)
# ===== 2. 스트리밍 응답 =====
stream = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "인공지능의 미래는?"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
# ===== 3. 이미지 분석 (Vision) =====
import base64
def encode_image(image_path):
with open(image_path, "rb") as f:
return base64.b64encode(f.read()).decode("utf-8")
response = client.chat.completions.create(
model="gpt-4o",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "이 이미지를 설명해주세요."},
{"type": "image_url", "image_url": {
"url": f"data:image/jpeg;base64,{encode_image('image.jpg')}"
}}
]
}
]
)
# ===== 4. Function Calling =====
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "특정 위치의 현재 날씨를 가져옵니다",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "도시 이름"}
},
"required": ["location"]
}
}
}]
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "서울 날씨 어때?"}],
tools=tools,
tool_choice="auto"
)
# ===== 5. Embedding 생성 =====
response = client.embeddings.create(
model="text-embedding-3-small",
input="검색할 텍스트입니다"
)
embedding = response.data[0].embedding
print(f"임베딩 차원: {len(embedding)}") # 1536
This is the OpenAI API price list as of January 2025.
| Model/Service | Price | Notes |
|---|---|---|
| GPT-4o | $2.50 / $10.00 (1M tokens) | Input/Output, 128K context |
| GPT-4o Mini | $0.15 / $0.60 (1M tokens) | Cost-efficient general-purpose model |
| o1 (Reasoning) | $15.00 / $60.00 (1M tokens) | For complex reasoning tasks |
| o1-pro | $150.00 / $600.00 (1M tokens) | Top-performance reasoning model |
| Embedding (3-small) | $0.02 / 1M tokens | 1536 dimensions |
| Embedding (3-large) | $0.13 / 1M tokens | 3072 dimensions |
| DALL-E 3 (Standard) | $0.04 ~ $0.08 / image | 1024x1024 ~ 1024x1792 |
| Whisper (speech recognition) | $0.006 / minute | Multilingual support |
Discount options: 50% discount for Batch API, 50% discount for prompt caching, and volume commitment discounts available.
"gpt-4o-mini is enough for simple classification or extraction tasks, and the cost is one-tenth. gpt-4o is suitable for complex analysis or code generation, and o3 or o4-mini for work requiring mathematical reasoning. GPT-5 is said to have reduced hallucinations by 80%, so it would be good for tasks where fact-checking is important."
"The OpenAI API provides various endpoints such as Chat Completions, Embeddings, Image Generation, and Audio. Function Calling enables integration with external APIs, and the Assistants API can be used to implement stateful conversations. As of 2025, GPT-5 is the latest flagship, and o3/o4-mini are the latest reasoning-specialized models. GPT-4.1 shows significant performance improvements in coding and instruction following."
"If you enable prompt caching, you can get a 50% discount on repeated requests. The Batch API gives a 50% discount on the condition of processing within 24 hours, and for embeddings, text-embedding-3-small is the cheapest at $0.02/1M."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
Entering an API key directly in source code risks leakage. Use environment variables or a Secret Manager.
If you get a 429 error, you need retry logic. Implement exponential backoff or use the automatic retry of the official SDK.
Choose a model that fits the use case, monitor costs with the Usage API, and add response validation logic for important requests. Consider Azure OpenAI for sensitive data.