GPT-4.1

Text & chatNewAvailable
by OpenAIModel ID: gpt-4-1

OpenAI's newest flagship model. Improved reasoning, instruction following, and coding over GPT-4o.

Price · 1M in / out
US$2.40 / US$9.60
Context
1,000,000 tokens
Max. output
32,768 tokens
Input → output
Text → Text
Developer
OpenAI
Updated
September 23, 2026
01

Playground

Try GPT-4.1

Chat

US$2.40/1M in
Try GPT-4.1

Send a message. The answer arrives in full once the model is done (no streaming).

System prompt
Max. answer length (tokens)

This run

at most US$0.0099 · 0.99 credits reserved

Billed by the tokens actually used; the unused part of the reservation is refunded.

New here?

10 free credits (US$0.10) when you sign up with Google

Usable 24 hours after sign-up, up to 5 runs per day and at most 2 credits per run. Other sign-in methods start without credits. Enough for 10 runs of this model.

02

About GPT-4.1

TL;DRAs of September 23, 2026

GPT-4.1 is a model by OpenAI in the Text & chat category. On Railwail, GPT-4.1 costs US$2.40 per 1M input tokens and US$9.60 per 1M output tokens. The context window holds 1,000,000 tokens, and one response can be up to 32,768 tokens long.

Background

About OpenAI

Founded 2015 · San Francisco, USA

OpenAI was founded in 2015 as a non-profit research lab by Sam Altman, Elon Musk, Greg Brockman, Ilya Sutskever, Wojciech Zaremba and John Schulman. In 2019 it transitioned into a capped-profit company to raise capital from Microsoft, which has invested over $13 billion. OpenAI is the publisher of the GPT series papers (GPT-1 in 2018, GPT-2 in 2019, GPT-3 in 2020, GPT-4 Technical Report in 2023), the InstructGPT paper that introduced RLHF for instruction following, and the GPT-4o System Card. Major products include ChatGPT (launched November 2022, with over 200M weekly active users), the OpenAI API, the o-series reasoning models, Sora for text-to-video and DALL-E for image generation. GPT-4.1 was released in April 2025 as an API-only model family (4.1, 4.1 mini and 4.1 nano) optimised for developers, with major improvements over GPT-4o on coding, instruction following and long-context tasks. The 2025 reported valuation exceeded $300 billion.

Visit OpenAI

Architecture

Decoder-only Transformer (developer-focused flagship)

GPT-4.1 launched in April 2025 as an API-only successor to GPT-4o aimed primarily at developers and agentic workloads. It is a decoder-only Transformer trained on an updated multi-trillion-token mixture of text, code and image-text pairs, with a knowledge cutoff of June 2024. The model family ships in three sizes (4.1, 4.1 mini, 4.1 nano) sharing the same training recipe but distilled to different capability/latency points. The headline change versus GPT-4o is a 1,047,576-token context window (~1M tokens), validated with new long-context evaluations such as OpenAI's MRCR (Multi-Round Coreference Resolution) and Graphwalks benchmarks. Post-training emphasised coding (SWE-bench Verified moved to 54.6% from 33% on GPT-4o), instruction following on edge-case formats, and reliable behaviour in long agent loops. OpenAI used reinforcement learning against verifiable rewards and large-scale synthetic data generation to push these axes. The model deprecates GPT-4.5 Preview from the API and is positioned as the production workhorse for ChatGPT Enterprise and Team deployments. Vision input is supported in all three sizes, function calling and Structured Outputs are first-class, and pricing is roughly 26% cheaper than GPT-4o at launch.

Parameters
Undisclosed (estimated multi-hundred billion parameters dense)
Context
1,047,576 tokens

Capabilities

  • 1,047,576 token context window (~1M tokens)
  • Major coding improvement: 54.6% on SWE-bench Verified at launch
  • Strong instruction following on edge-case formats and negative constraints
  • Reliable behaviour over long agent loops
  • Vision input across all three model sizes (4.1, mini, nano)
  • Function calling, parallel tool calls and Structured Outputs
  • Knowledge cutoff June 2024 (later than GPT-4o)
  • About 26% cheaper than GPT-4o at launch
  • Diff-style file editing and applied-diff coding workflows
  • Improved multilingual non-English benchmark performance
  • Best for: coding agents, IDE copilots, large-document analysis, production assistants.

Training & license

Pretrained on a multi-trillion-token web-scale mixture of text, code repositories, books, licensed datasets and image-text pairs. Knowledge cutoff is June 2024. Post-training combined supervised fine-tuning, RLHF and reinforcement learning against verifiable rewards (especially for code).

License: Proprietary commercial license via OpenAI API and Azure OpenAI Service. Not available through the ChatGPT consumer product.

Safety testing: Evaluated under OpenAI's Preparedness Framework v2 across CBRN, cyber, persuasion and autonomy axes. External red-teamers and OpenAI's Safety Advisory Group reviewed before launch.

Known limitations

  • API-only, no ChatGPT consumer access initially
  • 1M context window is supported but quality degrades on cross-document recall vs nominal capacity
  • Higher cost than GPT-4o mini for cost-sensitive use cases
  • Still hallucinates citations and exact quotes
  • No native audio I/O (use GPT-4o for voice)
03

Pricing

Prices in US dollars. Usage is charged from prepaid credits.
InputUS$2.40 / 1M tokens
OutputUS$9.60 / 1M tokens
  • Billed by the tokens each request actually uses.
  • 1 credit = US$0.01

Cost calculator

Price calculator

/ req.
/ req.

Total

US$0.72

72 credits

Per request

US$0.0072 · 0.72 credits

Each request is rounded up to 0.01 credits.

04

API

Call GPT-4.1 with your Railwail API key. Use this model ID in the request:
curl https://railwail.com/api/v1/chat/completions \
  -H "Authorization: Bearer $RAILWAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4-1",
    "messages": [
      {
        "role": "user",
        "content": "Explain what a vector database is in two sentences."
      }
    ],
    "max_tokens": 1024
  }'
Set your key as RAILWAIL_API_KEYCreate API key
05

Specifications

Model ID
gpt-4-1
Developer
OpenAI
Category
Text & chat
Input
Text
Output
Text
Context window
1,000,000 tokens
Max. output
32,768 tokens
Billing
By usage (tokens or GPU time)
Model size
Undisclosed (estimated multi-hundred billion parameters dense)
License
Proprietary commercial license via OpenAI API and Azure OpenAI Service. Not available through the ChatGPT consumer product.
Catalog entry updated
September 23, 2026

Tags

  • popular
  • coding
  • reasoning
06

Example prompts

Examples from the Railwail catalog. They were not generated live on this page.
  • System Design

    Design a URL shortener service. What are the key components and how would you handle 10 million requests per day?
    Show example answer

    A URL shortener at 10M req/day needs: 1) An API layer behind a load balancer to accept long URLs and return short codes. 2) A base62 encoding scheme (a-z, A-Z, 0-9) generating 6-character codes, yielding 56 billion unique URLs. 3) A distributed key-value store like Redis for fast lookups with a persistent database (PostgreSQL) as the source of truth. 4) A caching layer (CDN + Redis) since reads vastly outnumber writes. 5) Rate limiting per IP/API key to prevent abuse. At ~115 req/sec average, a few application servers with horizontal scaling can handle the load comfortably.

  • Instruction Following

    Write exactly 3 sentences about black holes. Each sentence must contain exactly 10 words. Do not use the word 'space'.
    Show example answer

    Black holes form when massive stars collapse under their gravity. Light cannot escape the intense gravitational pull they create. Scientists study these mysterious objects using powerful telescopes and math.

07

Use cases

What it is used for

  • Autonomous coding agents
  • IDE copilots and pair programmers
  • Long-document and codebase analysis
  • Customer support over 1M token transcripts
  • Enterprise RAG and chat assistants
  • Tool-using agents in production
08

Frequently asked questions

What is GPT-4.1?

GPT-4.1 is a model by OpenAI in the Text & chat category. On Railwail you can call it with an API key through the Railwail API.

How much does GPT-4.1 cost on Railwail?

On Railwail, GPT-4.1 costs US$2.40 per 1M input tokens and US$9.60 per 1M output tokens. You are charged for what each request actually uses. Usage is paid from prepaid credits; 1 credit equals US$0.01.

What is the context window of GPT-4.1?

The context window of GPT-4.1 holds 1,000,000 tokens. One response can be up to 32,768 tokens long.

How fast is GPT-4.1?

There are not enough measured runs of GPT-4.1 on Railwail yet to state a run time. It depends on the input, the settings and the load at the provider.

Is GPT-4.1 better than Claude Fable 5.1?

That depends on the task. GPT-4.1 (OpenAI) and Claude Fable 5.1 (Anthropic) are both models in the Text & chat category. The comparison page shows their prices and specifications side by side.

Compare GPT-4.1 and Claude Fable 5.1

How do I use GPT-4.1 through the API?

Create a Railwail API key and send your request with the model ID gpt-4-1. Code examples for curl, Python and JavaScript are in the API section of this page.

09

Comparable models

All in this category
  • Anthropic's model for the most demanding reasoning and long-horizon agentic work. 1M-token context window, up to 128K output tokens, adaptive thinking that is always on.

    US$12.00/1M in

    400 % more expensive per unit

    Compare GPT-4.1 vs. Claude Fable 5.1
  • The most capable model of Anthropic's Opus 4 series. State of the art on long-horizon agentic work, coding and knowledge tasks, with a 1M-token context window at standard pricing.

    US$6.00/1M in

    150 % more expensive per unit

    Compare GPT-4.1 vs. Claude Opus 4.8
  • Anthropic's current Opus model for long-running agentic coding and knowledge work. 1M-token context window, up to 128K output tokens, adaptive thinking that is always on.

    US$4.80/1M in

    100 % more expensive per unit

    Compare GPT-4.1 vs. Claude Opus 5.5

Use GPT-4.1 via the API

One API key for every model on Railwail. Usage is charged from prepaid credits, 1 credit = US$0.01.