GPT-5.2 API

GPT-5.2 is OpenAI's next-generation language model with extended context and enhanced performance.

Modalities
TextText
In / Out price
$1.75/$14per 1M
Context window
400K tokens
Released
Dec 11, 2025

GPT-5.2 overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by GPT-5.2 through AI/ML API

GPT-5.2 by OpenAI

With significant upgrades in reasoning, vision, coding, and long-context handling, GPT-5.2 delivers state-of-the-art performance across professional tasks.

GPT-5.2 specs

Model ID
openai/gpt-5-2
Developer
OpenAI
Context window
400,000 tokens
Max output
128,000 tokens
Input
Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

GPT-5.2 API Overview

GPT-5.2 represents OpenAI's latest advancement in large language models, engineered for deeper analytical work and superior handling of complex, real-world tasks. It excels at coding assistance, long-document summarization, precise analysis of uploaded files, step-by-step math and logic breakdowns, and structured support for planning and decision-making with enhanced clarity and actionable detail.

This model builds on prior iterations with refined reasoning chains and output polish, making it ideal for professional workflows requiring reliability and depth across technical and cognitive domains.

Technical Specifications

  • Architecture: Transformer-based generative LLM
  • Context Length: Up to 64K tokens (extended context)
  • Capabilities: Chat, reasoning, multimodal integration, code generation, tool usage
  • Training Data: Diverse web-scale corpora, scientific literature, dialogue, and code datasets with human feedback alignment (RLHF)
  • Inference Enhancements: Adaptive attention mechanisms and optimized transformer kernels for reduced latency and energy consumption

Performance Benchmarks

  • Logical Reasoning: Superior stability and accuracy on multi-step reasoning tasks
  • Code Generation: High functional correctness across multiple programming languages
  • Multilingual Understanding: Supports 40+ languages with strong contextual retention
  • Extended Context Tasks: Maintains coherence and factual integrity on inputs exceeding 50K tokens
  • Few-shot Learning: 30% improvement in generalization compared to GPT-5.0

Quality Improvements

  • Maintains coherent reasoning across million-token contexts without drift.
  • Step-by-step breakdowns now include verifiable logic paths for math, code, and decisions.
  • Enhanced file understanding delivers context-aware summaries and Q&A with precise citations.
  • Balanced professional tone with actionable structure, minimizing vague or overly verbose outputs.

New Features & Technical Upgrades

  • Adaptive Reasoning Mode: Silent multi-step cognitive pass before output reduces errors and contradictions
  • Extended Context Window (64K tokens): Enables long-form document processing, sustained dialogs, and data-driven reasoning
  • Multimodal Compatibility: Seamless integration with vision and speech modalities for richer input/output pipelines
  • Safe Output Layers: Refined RLHF ensures stronger guardrails against toxic or biased content
  • Efficiency Optimizations: 20% faster inference with 15% lower energy use versus prior versions

Practical Impact

These technical innovations empower GPT-5.2 to deliver high-precision AI assistance for enterprises, developers, educators, and researchers. Ideal for applications requiring reliable long-context understanding, coding tools, multilingual communication, and content creation workflows.

Use cases

GPT-5.2 is documented as suited for code-heavy and multi-step agentic tasks, including complex reasoning and broad world knowledge. It is also described as useful for creating spreadsheets, building presentations, writing code, and handling complex, multi-step projects. For professional engineering work, it is presented as a model for debugging production code, implementing feature requests, refactoring large codebases, and shipping fixes end-to-end with less manual intervention. It is additionally described as well suited for analyzing long documents, such as reports, contracts, research papers, transcripts, and multi-file projects, with support for deep analysis, synthesis, and complex multi-source workflows.

Capabilities

  • Function calling
  • Streaming
  • Structured outputs
  • Reasoning
  • Web search

GPT-5.2 benchmarks by Artificial Analysis

See how GPT-5.2 compares in generation speed. Data retrieved Nov 3, 2026.

Speed

Output tokens / second

Benchmark results

Compare 16 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

GPT-5.2 API pricing

GPT-5.2 pricing in US dollars
UsagePriceUnit
Input$1.751M tokens
Output$141M tokens
Cached input$0.1751M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

GPT-5.2 vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
GPT-5.2$1.75$14
GPT-6 Luna$0.1$0.5
GPT-6.1 Terra$1$5
GPT-6.1 Sol$2$10
GPT-6.1 Terra Pro$2.12$10.58

How to use the GPT-5.2 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-5-2",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

GPT-5.2 FAQ

What is the context window of GPT-5.2?

GPT-5.2 has a 400,000 tokens context window and can return up to 128,000 tokens.

What inputs and outputs does GPT-5.2 support?

GPT-5.2 takes image, text as input and returns text.

What is the model ID for GPT-5.2?

Use openai/gpt-5-2 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

How much does GPT-5.2 cost?

GPT-5.2 costs $1.75 input and $14 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does GPT-5.2 support streaming?

Yes, GPT-5.2 can stream responses as they are generated.

Can GPT-5.2 read images?

Yes, GPT-5.2 accepts image input alongside text.

Who created GPT-5.2?

GPT-5.2 was built by OpenAI.

Does GPT-5.2 support function calling and tool use?

Yes, it supports function calling, parallel tool calls, and structured outputs.

Start building with GPT-5.2

GPT-5.2 API

openai/gpt-5-2

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-5-2",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'