GPT-4.1 Mini API

GPT-4.1 mini is a cost-effective variant of GPT-4.1 with 1M token context, optimized for speed and efficiency.

Modalities
Text, ImageText
In / Out price
$0.4/$1.6per 1M
Context window
1M tokens
Released
Apr 14, 2025

GPT-4.1 Mini overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by GPT-4.1 Mini through AI/ML API

GPT-4.1 Mini specs

Model ID
openai/gpt-4.1-mini-2025-04-14
Developer
OpenAI
Context window
1,000,000 tokens
Input
Text, Image
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

GPT-4.1 Mini Description

GPT-4.1 Mini is OpenAI's mid-tier model in the GPT-4.1 family, designed to provide a balance between high performance and cost efficiency. It delivers capabilities comparable to the full GPT-4.1 model at significantly lower cost, making it ideal for applications where budget considerations are important but performance can't be compromised. The model excels at coding tasks, instruction following, and processing long contextual information, offering enterprises and developers an efficient solution for a wide range of AI applications.

Context Window and Token Capacity

GPT-4.1 Mini processes input contexts of up to 1,047,576 tokens (approximately 750,000 words), matching the full GPT-4.1 model's capacity. The model generates outputs of up to 32,768 tokens in a single response. All training data for GPT-4.1 Mini extends to May 31, 2024, which serves as its knowledge cutoff date.

Performance Benchmarks

GPT-4.1 Mini demonstrates strong performance across multiple benchmarks, offering capabilities that in many cases match or come close to the full GPT-4.1 model:

  • Visual Reasoning (MathVista): 73.1% accuracy (slightly outperforming the full GPT-4.1 model)
  • Instruction Following: Near-parity with GPT-4.1 on instruction benchmarks
  • Long Context Processing: Full 1M token context handling with maintained coherence
  • Multi-document Analysis: Strong performance on legal and financial document analysis

Programming and Software Development

GPT-4.1 Mini delivers strong coding capabilities with minimal performance tradeoff compared to the full model. It provides effective code refactoring and debugging features for a wide range of programming languages. The model follows programming best practices with high reliability across multiple frameworks and languages. It generates optimized code with fewer extraneous edits compared to previous models. GPT-4.1 Mini supports practical development workflows including repository analysis and pull request generation. The system performs well across standard coding benchmarks, particularly for everyday development tasks.

Long Context Processing

GPT-4.1 Mini processes and reasons over documents containing up to 1 million tokens with strong coherence throughout. The model retrieves specific information from large documents effectively even when key data is deeply embedded. It analyzes complex codebases and multiple documents with improved accuracy over previous generations. GPT-4.1 Mini handles multi-document analysis with strong performance for research and business applications. Like the full model, it is optimized for XML-style delimiters to enhance structure in long-context inputs.

Balanced Performance and Efficiency

GPT-4.1 Mini offers 83% lower cost than GPT-4o while outperforming it on many benchmarks. The model achieves enhanced latency and response speed compared to more expensive models. It balances computational efficiency with strong performance across diverse tasks. GPT-4.1 Mini provides significantly higher quality results than comparably priced models from previous generations. The system delivers optimal resource utilization for high-volume, production-scale deployments.

Use cases

  • Software development and AI pair programming
  • Enterprise meeting transcription and analysis
  • Image-based report generation and visual data interpretation
  • Advanced customer support and knowledge management
  • Automated workflows requiring long-context understanding and complex reasoning

Capabilities

  • Function calling
  • Streaming
  • Structured outputs
  • Reasoning
  • Web search

GPT-4.1 Mini benchmarks by Artificial Analysis

See how GPT-4.1 Mini compares in generation speed and latency. Data retrieved Nov 3, 2026.

Speed

Output tokens / second

Benchmark results

Compare 16 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

GPT-4.1 Mini API pricing

GPT-4.1 Mini pricing in US dollars
UsagePriceUnit
Input$0.41M tokens
Output$1.61M tokens
Cached input$0.11M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

GPT-4.1 Mini vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
GPT-4.1 Mini$0.4$1.6
GPT-6 Luna$0.1$0.5
GPT-6.1 Terra$1$5
GPT-6.1 Sol$2$10
GPT-6.1 Terra Pro$2.12$10.58

How to use the GPT-4.1 Mini API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-4.1-mini-2025-04-14",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

GPT-4.1 Mini FAQ

What is the context window of GPT-4.1 Mini?

GPT-4.1 Mini has a 1,000,000 tokens context window.

What inputs and outputs does GPT-4.1 Mini support?

GPT-4.1 Mini takes image, text as input and returns text.

What is the model ID for GPT-4.1 Mini?

Use openai/gpt-4.1-mini-2025-04-14 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

When was GPT-4.1 Mini released?

GPT-4.1 Mini became available on August 7, 2025.

How much does GPT-4.1 Mini cost?

GPT-4.1 Mini costs $0.4 input and $1.6 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does GPT-4.1 Mini support streaming?

Yes, GPT-4.1 Mini can stream responses as they are generated.

Can GPT-4.1 Mini read images?

Yes, GPT-4.1 Mini accepts image input alongside text.

Who created GPT-4.1 Mini?

GPT-4.1 Mini was built by OpenAI.

Can GPT-4.1 Mini call external tools or functions?

Yes, it supports function calling, tools, and parallel tool calls.

Start building with GPT-4.1 Mini

GPT-4.1 Mini API

openai/gpt-4.1-mini-2025-04-14

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "openai/gpt-4.1-mini-2025-04-14",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'