OpenAI Releases GPT-4.1 API With One Million Token Context
OpenAI has released GPT-4.1 via its API, offering developers a one-million-token context window and coding improvements.
What Happened
OpenAI released GPT-4.1 through its application programming interface, making the model available to developers building software products on the company's platform. The release introduces a context window of one million tokens, the largest the company has offered in a production API model, alongside performance improvements the company says are concentrated in coding and instruction-following tasks.
Background
OpenAI, the San Francisco-based AI company backed by Microsoft, operates one of the most widely used commercial AI APIs in the industry. The company's API products are used by businesses ranging from startups to large enterprises to embed language model capabilities into their own applications. GPT-4.1 follows the GPT-4o line of models and is positioned as an API-focused release rather than a consumer-facing product update. OpenAI did not announce GPT-4.1 for use in ChatGPT at the time of release.
Context window size is a measure of how much text a model can process in a single interaction. A one-million-token context window is equivalent to roughly 750,000 words, enabling developers to submit very large documents, codebases, or conversation histories in a single API call. Prior to this release, GPT-4o supported a context window of 128,000 tokens in standard API access.
What the Release Includes
OpenAI released GPT-4.1 in three variants: the full GPT-4.1 model, GPT-4.1 mini, and GPT-4.1 nano. The nano variant is the smallest and least expensive of the three, targeted at high-volume, cost-sensitive use cases. The mini variant sits between nano and the full model on both capability and price. All three variants share the one-million-token context window.
The company stated that GPT-4.1 shows measurable gains on coding benchmarks compared to GPT-4o, including on SWE-bench, an evaluation that tests models on real-world software engineering tasks drawn from open-source repositories. OpenAI reported a score of 54.6 percent on SWE-bench Verified for GPT-4.1, compared to 33.2 percent for GPT-4o.
OpenAI also stated that GPT-4.1 demonstrates improved ability to follow complex, multi-step instructions and reduces instances of unsolicited behavior changes compared to prior models.
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 40 cents per million input tokens and one dollar and 60 cents per million output tokens. GPT-4.1 nano is priced at 10 cents per million input tokens and 40 cents per million output tokens. The pricing positions GPT-4.1 as less expensive than OpenAI's o-series reasoning models while offering a larger context window than GPT-4o at comparable price points.
Market Context
The release comes as competition in the commercial AI API market has intensified. Google offers its Gemini 2.5 Pro model with a one-million-token context window through its own API. Anthropic offers Claude models through its API with a 200,000-token context window. Meta has released the Llama 4 family of open-weight models, which developers can self-host. The simultaneous availability of large context windows across multiple providers has made context length a standard competitive dimension rather than a differentiating feature for any single vendor.
Microsoft, which has a broad partnership with OpenAI and distributes OpenAI models through its Azure cloud platform, is expected to make GPT-4.1 available through Azure AI Foundry following the API release.
What Happens Next
OpenAI has indicated that GPT-4.1 will remain an API-only model for the near term, with no announced timeline for integration into ChatGPT or other consumer products.
Get our editors' take on what it all means. Read the Editor's Blog →