Back to Models

GPT-4.1

openaiopenai/gpt-4.1

OpenAI's smartest non-reasoning model. Excels at instruction following and tool calling with broad knowledge across domains. Features a 1M token context window and low latency.

GPT-4.1 is OpenAI's latest non-reasoning flagship model, released in April 2025 as a direct successor to GPT-4o and GPT-4.5 Preview. It delivers significant gains in coding, instruction following, and long-context comprehension β€” supporting up to 1 million tokens of context β€” while maintaining a refreshed knowledge cutoff of June 2024 and lower pricing than GPT-4o.

In production stacks, GPT-4.1 excels at agentic software engineering, code diff generation, and complex instruction-following across large codebases. With the OpenAI Responses API, it functions as a powerful agent backend β€” capable of autonomously resolving GitHub issues, extracting insights from large documents, and handling multi-turn customer support. It also marks OpenAI's deprecation of GPT-4.5 Preview (scheduled for July 14, 2025), as GPT-4.1 matches or exceeds its capabilities at lower cost and latency.

Best for
  • β€’ Agentic software engineering β€” SWE-bench Verified 54.6%, with strong performance on real-world code repositories and GitHub issue resolution
  • β€’ Code diff generation β€” reliable search/replace and diff-format patches across programming languages via Aider polyglot benchmark
  • β€’ Long-context understanding β€” 1M token window with new SOTA on Video-MME long no-subtitles benchmark (72.0%)
Reach for something else if
  • β€’ Simple single-turn classification or autocompletion β€” route to GPT-4.1 Nano instead for much lower latency and cost (80%+ MMLU at micro-cost)
  • β€’ Tasks requiring deep step-by-step reasoning β€” GPT-4.1 is a non-reasoning model; use o3 or o4-mini for chain-of-thought reasoning
Context Length
1.0M
Max Output
33K
Input Priceper 1M tokens
$2.16/ 1M tokens
Output Priceper 1M tokens
$8.64/ 1M tokens

Modalities

textimage→text

Capabilities

Vision

Pricing Breakdown

TypeRate
Input$2.16 / 1M tokens
Output$8.64 / 1M tokens

Supported Parameters

temperaturemax_tokenstop_ptoolstool_choiceresponse_formatstop

Specifications

Release date2025-04-14openai.com β†—verified
Knowledge cutoffJune 2024openai.com β†—verified
LicenseCommercial via OpenAI APIopenai.com β†—verified
Max output tokens32,768openai.com β†—verified
DeprecatesGPT-4.5 Preview (July 14, 2025)openai.com β†—verified

Benchmarks

BenchmarkDistributionScoreSource
SWE-bench Verified
54.6% with 23/500 tasks excluded as infrastructure-incompatible (52.1% if scored as 0). +21.4pp over GPT-4o.
54.6%%openai.com β†—
Scale MultiChallenge
Instruction following benchmark. +10.5pp over GPT-4o.
38.3%%openai.com β†—
Video-MME (long, no subtitles)
State-of-the-art for multimodal long-context understanding. +6.7pp over GPT-4o.
72.0%%openai.com β†—
Aider Polyglot (diff)
More than doubles GPT-4o's score. Beats GPT-4.5 by 8pp on diff-format coding edits.
Best in classopenai.com β†—

API Usage Examples

Use the global api.therouter.ai endpoint shown below for new integrations; the legacy China accelerated endpoint is retired.

cURL
curl https://api.therouter.ai/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer $THE_ROUTER_API_KEY"   -d '{
    "model": "openai/gpt-4.1",
    "messages": [
      {"role": "user", "content": "Summarize the key points from this input."}
    ]
  }'

Chat completion

cURL
curl https://api.therouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4.1","messages":[{"role":"user","content":"Hello"}]}'

More from openai

Similar models

Cross-provider sibling models

News & changes

2025-04-14

OpenAI launches GPT-4.1 family with 1M context, better coding, lower prices

OpenAI releases GPT-4.1, GPT-4.1 Mini, and GPT-4.1 Nano β€” the new non-reasoning flagship family. GPT-4.1 achieves 54.6% on SWE-bench Verified (+21.4pp vs GPT-4o) and a new SOTA on Video-MME. GPT-4.5 Preview is deprecated, with a July 14 shutdown date.

re-authored by TheRouteropenai.com β†—
2025-07-14

GPT-4.5 Preview deprecation deadline

GPT-4.5 Preview will be retired from the API. Developers are directed to migrate to GPT-4.1, which offers comparable or superior performance on most capabilities at lower cost and latency.

re-authored by TheRouteropenai.com β†—

Frequently asked

Is GPT-4.1 a reasoning model like o3?

No. GPT-4.1 is a non-reasoning (direct response) model. It does not produce visible chain-of-thought tokens. For tasks that benefit from deep deliberation, use o3 or o4-mini. GPT-4.1 excels at fast, instruction-following, tool-based workflows.

How does GPT-4.1 compare to GPT-4o in coding?

GPT-4.1 significantly outperforms GPT-4o across all coding benchmarks: SWE-bench Verified 54.6% vs 33.2% (+21.4pp), Aider polyglot diff more than doubles GPT-4o's score, and extraneous code edits drop from 9% to 2%. It also features a larger 32,768 output token limit (vs 16,384 for GPT-4o).

Should I migrate from GPT-4.5 Preview to GPT-4.1?

Yes β€” GPT-4.5 Preview is scheduled for deprecation on July 14, 2025. GPT-4.1 offers comparable or better performance on most key capabilities β€” especially coding and instruction following β€” at significantly lower price ($2/M input vs $75/M for GPT-4.5 Preview) and lower latency. For creative tasks where GPT-4.5's unique style was valued, OpenAI plans to carry those improvements into future API models.

Fact ledger β€” every claim on this page traces here
sourceURLretrieved
Release dateopenai.com β†—2026-05-28verified
Knowledge cutoffopenai.com β†—2026-05-28verified
Licenseopenai.com β†—2026-05-28verified
Max output tokensopenai.com β†—2026-05-28verified
Deprecatesopenai.com β†—2026-05-28verified
SWE-bench Verifiedopenai.com β†—2026-05-28verified
Scale MultiChallengeopenai.com β†—2026-05-28verified
Video-MME (long, no subtitles)openai.com β†—2026-05-28verified
Aider Polyglot (diff)openai.com β†—2026-05-28verified
OpenAI launches GPT-4.1 family with 1M context, better coding, lower pricesopenai.com β†—2026-05-28verified
GPT-4.5 Preview deprecation deadlineopenai.com β†—2026-05-28verified
Is GPT-4.1 a reasoning model like o3?openai.com β†—2026-05-28to verify
How does GPT-4.1 compare to GPT-4o in coding?openai.com β†—2026-05-28to verify
Should I migrate from GPT-4.5 Preview to GPT-4.1?openai.com β†—2026-05-28to verify
Help & contact