OpenAI Opens GPT-4.1 API to Developers With 1M Token Context
OpenAI released GPT-4.1 via API, offering developers a one-million-token context window and improved coding performance.
What Happened
OpenAI released GPT-4.1 through its application programming interface on April 14, 2025, making the model available to developers building third-party applications. The release introduces a context window of one million tokens, the largest the company has offered in a production API model, alongside two smaller variants: GPT-4.1 mini and GPT-4.1 nano.
The Model and Its Specifications
GPT-4.1 supports a one-million-token input context, which OpenAI said allows developers to process large codebases, lengthy documents, and extended conversation histories within a single request. The model was trained with a knowledge cutoff of early 2025.
OpenAI released three tiers of the model. GPT-4.1 is the full-size flagship version. GPT-4.1 mini is a mid-range option designed to balance performance and cost. GPT-4.1 nano is the smallest and lowest-cost variant, intended for latency-sensitive or high-volume applications.
The company stated that GPT-4.1 shows measurable improvements over GPT-4o on coding benchmarks, including SWE-bench, which tests a model's ability to resolve real-world software engineering tasks. OpenAI did not release a standalone consumer-facing product alongside the API launch; the model is currently available only through the API.
Pricing
OpenAI priced GPT-4.1 at two dollars per million input tokens and eight dollars per million output tokens. GPT-4.1 mini is priced at forty cents per million input tokens and one dollar sixty cents per million output tokens. GPT-4.1 nano is priced at ten cents per million input tokens and forty cents per million output tokens.
The pricing structure positions GPT-4.1 below GPT-4o in cost per token for input, while the nano tier targets use cases where inference cost is the primary constraint for developers.
Background
OpenAI, founded in 2015 and headquartered in San Francisco, is the maker of ChatGPT and operates one of the most widely used AI API platforms among developers and enterprise customers. The company has released several model families in recent months, including the o3 and o4-mini reasoning models and earlier iterations of the GPT-4 series.
The one-million-token context window places GPT-4.1 in direct competition with Google's Gemini 1.5 Pro and Gemini 2.5 Pro, both of which also support one-million-token contexts. Anthropic's Claude 3.7 Sonnet supports a two-hundred-thousand-token context window.
Context window size has become a competitive dimension in the API market, as enterprise customers increasingly require models that can ingest and reason over large volumes of text, code, or data in a single inference call.
Developer Access and Availability
GPT-4.1 is accessible through the OpenAI API immediately following the announcement. Developers with existing OpenAI API accounts can call the model using the identifiers gpt-4.1, gpt-4.1-mini, and gpt-4.1-nano. The model supports both text and image inputs, maintaining the multimodal capabilities present in GPT-4o.
OpenAI also announced that GPT-4.1 will eventually replace GPT-4o as the default model in certain API contexts, though the company did not specify a timeline for that transition at the time of release.
What It Means in Practice
For developers, the one-million-token context window means that tasks such as reviewing an entire software repository, summarizing a book-length document, or maintaining a very long conversational history can be handled in a single API call rather than requiring chunking or retrieval strategies.
The nano tier extends OpenAI's reach into applications where cost and speed take priority over maximum capability, such as autocomplete features, real-time classification, or lightweight chatbots deployed at scale.
OpenAI has said it plans to introduce GPT-4.1 into additional products and services in the coming weeks.
Get our editors' take on what it all means. Read the Editor's Blog →