gpt-5.2

Common Name: GPT-5.2

OpenAI
Released on Dec 11 12:00 AMKnowledge Cutoff Aug 31 12:00 AMTool InvocationReasoning

GPT-5.2 is OpenAI's best model for coding and agentic tasks across industries.

Specifications

Context400,000
Maximum Output128,000
Inputtext, image
Outputtext

Performance (7-day Average)

Uptime
TPS
RURT

Pricing

Standard
Input$1.93/MTokens
Output$15.40/MTokens
Cached Input$0.19/MTokens
Flex
Input$0.96/MTokens
Output$7.70/MTokens
Cached Input$0.10/MTokens
Batch
Input$0.96/MTokens
Output$7.70/MTokens
Cached Input$0.10/MTokens

Usage Statistics

No usage data available for this model during the selected period
View your usage statistics for this model

Similar Models

$1.38/$11.00/M
ctx400Kmax128Kavailtps
InOutCap

GPT-5 Chat points to the GPT-5 snapshot currently used in ChatGPT. GPT-5 is our next-generation, high-intelligence flagship model. It accepts both text and image inputs, and produces text outputs.

$1.38/$11.00/M
ctx400Kmax128Kavailtps

GPT-5.1-Codex is a version of GPT-5 optimized for agentic coding tasks in Codex or similar environments. It's available in the Responses API only and the underlying model snapshot will be regularly updated. If you want to learn more about prompting GPT-5-Codex, refer to our dedicated guide

$0.25/$2.00/M
ctx400Kmax128Kavailtps
InOutCap

GPT-5.1-Codex-Max is a version of GPT-5.1-Codex with enhanced capabilities for agentic coding tasks.

$1.38/$11.00/M
ctx400Kmax128Kavailtps

GPT-5.1 is the OpenAI's best model for coding and agentic tasks across industries.

Documentation

GPT-5.2

GPT-5.2 is OpenAI's most advanced frontier model, released on December 11, 2025. It features a massive 400K token context window, 128K max output tokens, and state-of-the-art performance on coding, math, and scientific tasks.

Key Features

  • 400K Context Window: Process entire codebases or document collections in a single request
  • 128K Max Output: Generate comprehensive responses without truncation
  • Enhanced Reasoning: New xhigh reasoning effort level for expert-level problem-solving
  • Multimodal: Support for text and image inputs/outputs
  • Knowledge Cutoff: August 31, 2025

Model Variants

VariantBest ForReasoning Levels
GPT-5.2General tasks, balanced speed/qualitynone to xhigh
GPT-5.2 ProScientific research, expert-level accuracymedium, high, xhigh

Basic Usage

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.ohmygpt.com/v1",
    api_key="your-api-key",
)

response = client.chat.completions.create(
    model="gpt-5.2",
    messages=[
        {"role": "user", "content": "Explain quantum computing in simple terms."}
    ],
)

print(response.choices[0].message.content)

Using Reasoning Mode

Control thinking depth with the reasoning_effort parameter for complex tasks:

python
response = client.chat.completions.create(
    model="gpt-5.2",
    messages=[
        {
            "role": "user",
            "content": "Write a Python function to find the longest palindromic substring."
        }
    ],
    reasoning_effort="high",
    max_completion_tokens=16384,
)

print(response.choices[0].message.content)

Reasoning Effort Levels

LevelDescriptionUse Case
noneNo reasoning (default for GPT-5.2)Fast responses, simple queries
minimalMinimal reasoningQuick tasks, low latency
lowLight reasoningBalanced speed and accuracy
mediumModerate reasoningGeneral problem-solving
highDeep reasoningComplex math, coding, analysis
xhighMaximum reasoning (new in 5.2)Scientific research, expert-level tasks

Vision Example

Analyze images, charts, and documents with multimodal input:

python
response = client.chat.completions.create(
    model="gpt-5.2",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Analyze this chart and summarize the key trends."},
                {
                    "type": "image_url",
                    "image_url": {"url": "https://example.com/chart.png"}
                }
            ]
        }
    ],
)

Long Context Example

Process entire codebases or large documents with the 400K context window:

python
# Read a large codebase or document
with open("large_codebase.txt", "r") as f:
    codebase = f.read()

response = client.chat.completions.create(
    model="gpt-5.2",
    messages=[
        {
            "role": "system",
            "content": "You are a senior software architect reviewing code."
        },
        {
            "role": "user",
            "content": f"Review this codebase and identify potential security vulnerabilities:\n\n{codebase}"
        }
    ],
    reasoning_effort="high",
    max_completion_tokens=32768,
)

Best Practices

  1. Match Reasoning to Task Complexity: Use none/minimal for simple queries, high/xhigh for complex reasoning
  2. Use max_completion_tokens: Required when using reasoning models with Chat Completions API
  3. Leverage Long Context: Process entire codebases without chunking for better coherence
  4. Consider GPT-5.2 Pro: For scientific research or expert-level accuracy, use the Pro variant
  5. Cache When Possible: Cached inputs are 10x cheaper—reuse prompts where applicable