GPT-4.1
GPT-4.1 is a flagship large language model optimized for advanced instruction following, real-world software engineering, and long-context reasoning. It supports a 1 million token context window and outperforms GPT-4o and GPT-4.5 across coding (54.6% SWE-bench Verified), instruction compliance (87.4% IFEval), and multimodal understanding benchmarks. It is tuned for precise code diffs, agent reliability, and high recall in large document contexts, making it ideal for agents, IDE tooling, and ente
Context window
This model accepts 1.0M tokens in one request (~786K words of text).
What fits in one request
- FitsShort documentAbout 1,500 words of text
- FitsLong documentAbout 37K words of text
- FitsSmall codebaseAbout 150K words of text
- FitsFull novelAbout 375K words of text
Specifications
Context size, pricing, and release info in one place.
- Context window
- 1,047,576 tokens (1.0M)
- Max output tokens
- 32,768 tokens (33K)
- Speed tier
- balanced
- Provider
- Openai
- Model family
- GPT-4
- Release date
- Apr 2025
- Input cost
- $2.00/M / 1M tokens
- Output cost
- $8.00/M / 1M tokens
- Cached input
- $0.500/M / 1M tokens
Capabilities
See which features this model supports, such as vision, tools, and streaming.
- Vision
- Accepts image inputs alongside text
- Supported
- Tool use
- Can call external tools and APIs
- Supported
- Function calling
- Structured function call interface
- Supported
- Streaming
- Returns tokens as they are generated
- Supported
- Prompt caching
- Reuse repeated prompt prefixes cheaply
- Supported
- Extended thinking
- Shows its chain-of-thought reasoning
- Not supported
- Web search
- Can browse the web during a request
- Not supported
- Batch API
- Process many requests asynchronously
- Not supported
Best for
Jump to a guide or ranking that matches each workload.
Compare GPT-4.1
Open a side-by-side comparison with one click.
- GPT-4.1 vs Amazon Titan Text Express
GPT-4.1 has 2394% larger context window
- GPT-4.1 vs Amazon Titan Text Lite
GPT-4.1 has 2394% larger context window
- GPT-4.1 vs Amazon Titan Text Premier
GPT-4.1 has 2394% larger context window
- GPT-4.1 vs Claude Instant
GPT-4.1 has 947% larger context window
- GPT-4.1 vs Anthropic Claude
GPT-4.1 has 947% larger context window
- GPT-4.1 vs Codellama 34b Instruct
GPT-4.1 has 25475% larger context window
Frequently asked questions
Short answers about context size and how this model behaves.
More from Openai
Other models by Openai in our catalog.
Powered by Mem0
Use a smaller model.
Get better results.
Mem0 gives your AI long-term memory so you stop re-sending context on every call. That means you can use a smaller, faster, cheaper model — and still get better answers.
Example: a multi-turn chat session
80% less to send — works with any model