We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

OpenAI: GPT-4.1

openai/gpt-4.1
TextInput: image · text · fileTools1MAdded Apr 14, 2025

Try OpenAI: GPT-4.1 now

Runs on your balance at the prices above. New accounts start with free usage.

One API. Every model.

5 of 5 free messages left today. A free account adds free usage and an API key.Create free accountSign in

Session cost $0.00

OpenAI: GPT-4.1 at a glance

  • Input price is 344% higher than the median of 434 Text models.
  • Context window of 1,047,576 tokens, enough for long documents and multi-turn conversations.
  • Supports tool (function) calling for agents and integrations.
  • Supports structured JSON output with a schema.
  • Accepts images as input (vision).
  • A typical request (1,000 input / 500 output tokens) costs about $0.02.

About OpenAI: GPT-4.1

GPT-4.1 is a flagship large language model from OpenAI, released by the provider on 14 April 2025. It sits in the text category and is positioned for advanced instruction following, real-world software engineering, and long-context reasoning. If you are already working within the OpenAI family of models, this is the successor tier to GPT-4o, and it is aimed at workloads where careful adherence to instructions and large amounts of context matter more than raw speed.

The model accepts text, images, and files as input, and it returns text. Its context window is 1,047,576 tokens, which is just over one million tokens, and the maximum output is 32,768 tokens. The knowledge cutoff is 30 June 2024, so anything after that date is outside what the model was trained on. The combination of a very large context window and a moderate output ceiling means the model is well suited to reading far more than it writes, which is typical of analysis, review, and retrieval-style tasks.

Those capabilities point to a few practical uses. Long-context reasoning makes it a fit for working over large codebases, lengthy specifications, or multi-document sets in a single request rather than chunking them. Real-world software engineering suggests code review, refactoring, debugging, and test generation. Advanced instruction following helps with structured extraction and transformation tasks where the output format must be respected. Because images and files are accepted as input, you can also mix screenshots, diagrams, or documents into the same request as text.

You call the model through api14's OpenAI-compatible API using the model id "openai/gpt-4.1". The supported request parameters are max_completion_tokens, max_tokens, response_format, seed, structured_outputs, temperature, tool_choice, tools, and top_p. In practice that means you can control output length, request deterministic sampling with a seed, set temperature and top_p for randomness, constrain the response shape with response_format or structured_outputs, and define function calling through tools and tool_choice.

One limit worth noting is the output ceiling of 32,768 tokens. If your task is to generate a very long document in one pass, that cap will bind before the input context does, and you may need to split generation across calls. The knowledge cutoff of 30 June 2024 also means the model has no built-in awareness of later events, so anything recent has to come from the prompt or from tools you provide.

How to call the OpenAI: GPT-4.1 API

  1. Create an API key in your dashboard.
  2. Install the official openai SDK for your language.
  3. Set baseURL to https://api14.com/api/v1 and model to "openai/gpt-4.1".
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api14.com/api/v1",
  apiKey: process.env.API14_API_KEY,
});

const result = await client.chat.completions.create({
  "model": "openai/gpt-4.1",
  "messages": [
    {
      "role": "user",
      "content": "Explain vector databases in two sentences."
    }
  ]
});
console.log(result.choices[0].message.content);

Supported parameters

max_completion_tokensmax_tokensresponse_formatseedstructured_outputstemperaturetool_choicetoolstop_p

Specifications

Context length
1,047,576
Max output
32,768
Input
image, text, file
Output
text
Knowledge cutoff
2024-06-30

Requests on api14 · last 7 days

10-1710-1810-1910-2010-2110-2210-23

OpenAI: GPT-4.1: frequently asked questions

How much does the OpenAI: GPT-4.1 API cost?
OpenAI: GPT-4.1 costs Input $7.00 / 1M tokens. It is charged from your USD balance only for successful requests; failed requests are free.
What is the context window of OpenAI: GPT-4.1?
OpenAI: GPT-4.1 reads up to 1,047,576 tokens per request: prompt, history and documents together. It writes up to 32,768 output tokens per response.
What can OpenAI: GPT-4.1 do?
OpenAI: GPT-4.1 accepts image, text, file and returns text. It supports tool calling, structured JSON output.
How do I call OpenAI: GPT-4.1 from my code?
Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "openai/gpt-4.1". No other code changes. Copy a ready example from the code panel on this page.
What are alternatives to OpenAI: GPT-4.1?
Comparable Text models at a similar price: Pareto 26.9, OpenAI: o3, Perplexity: Sonar Reasoning Pro. Each runs through the same API key, so switching is one string.

OpenAI: GPT-4.1 community

New topic

This community has no topics yet. Open the first one about OpenAI: GPT-4.1.