GPT-4.1 mini API
$0.4/Mtok inOpenAI · text
OpenAI's April 2025 small model with a million-token window, still running inside a lot of production agents. Keep it as your baseline and test newer models against it on the same key.
Overview
About GPT-4.1 mini
GPT-4.1 mini is OpenAI's April 2025 small model: a 1,047,576-token context window, up to 32,768 output tokens, tools and image input, with a knowledge cutoff of June 2024. It is no longer OpenAI's newest small model, but many production agents were built and tuned on it, and OpenAI lists no shutdown date for it. Through CompanyFabric it runs on the same OpenAI-compatible key as GPT-6 Luna, Claude Haiku 4.5 and Gemini Flash, so you can keep it as your baseline and test a replacement by changing one string. Every model on CompanyFabric shares the same API key, billing balance, and rate-limit envelope, one integration covers the entire library.
Facts
At a glance
Availability
Live
Pricing
$0.4/Mtok in
Metered exactly per call
Context window
1,047.576k tokens
Commercial use
See license
Commercial output use permitted per OpenAI terms.
Variants
All endpoints
GPT-5.5
$5/Mtok inOpenAI's flagship, one key away.
Chat Completions
GPT-6 Astra
$10/Mtok inOpenAI's GPT-6 flagship, a million-token window one key away.
Chat Completions
GPT-6 Sol
$2/Mtok inGPT-6 for complex coding and agent work at a fifth of Astra's price, with the same million-token window.
Chat Completions
GPT-6 Luna
$0.1/Mtok inGPT-6's high-volume tier: the cheapest frontier-family model in the catalog, with a million-token window.
Chat Completions
GPT-4.1 mini
$0.4/Mtok inOpenAI's April 2025 small model with a million-token window, still running inside a lot of production agents. Keep it as your baseline and test newer models against it on the same key.
Chat Completions
Quickstart
How to use the GPT-4.1 mini API
- 1
Create a free CompanyFabric account, starter credits are included, no card required.
- 2
Copy your API key from the dashboard. One key covers every model in the library.
- 3
Point any OpenAI SDK at api.companyfabric.com/v1 and set model to "openai/gpt-4.1-mini".
- 4
Read the exact metered cost of the call from the response, the same number shown in the playground.
Use cases
What teams build with it
Baseline for model evals
An agent tuned on GPT-4.1 mini needs a like-for-like reference before it moves. Run the same conversations through it and a newer model on one key and compare the replies, the cost and the latency side by side.
evalsbaselinemigration
High-volume assistants
Support, booking and FAQ assistants where replies are short, traffic is high and the input price matters more than reasoning depth.
supportchatassistant
Small knowledge bases in context
A million-token window fits a full manual, price list or knowledge base in one call, so a small knowledge base can sit in the prompt instead of behind a retrieval step that might miss the one entry that matters.
long contextknowledge baseextraction
Get better output
Prompting tips
- Put the current date, weekday and timezone in the system prompt on every turn. The model has no clock, and a word like "tomorrow" only resolves correctly when it knows what today is.
- Keep the rules an agent must never break (opening hours, prices, what it cannot book) in the system prompt itself, not behind retrieval, so they are in context on every turn.
- It is not a reasoning model. When a request has to be checked against several rules, give it a tool that does the check and have it report the result, rather than trusting it to work the answer out.
Exact, metered, prepaid
GPT-4.1 mini pricing
GPT-4.1 mini is metered per token at OpenAI's published rate: $0.40 per million input tokens and $1.60 per million output. There is no long-context tier, so the rate is the same across the full window.
Every call is priced before you run it in the playground and metered exactly to your prepaid balance, no subscription, no minimum. BYOK routes your own OpenAI key at 0% platform fee.
| Endpoint | Type | Price |
|---|---|---|
| GPT-5.5 | Chat | $5 / M input · $30 / M output |
| GPT-6 Astra | Chat | $10 / M input · $50 / M output |
| GPT-6 Sol | Chat | $2 / M input · $10 / M output |
| GPT-6 Luna | Chat | $0.1 / M input · $0.5 / M output |
| GPT-4.1 mini | Chat | $0.4 / M input · $1.6 / M output |
Starter credits
Use GPT-4.1 mini free
Your CompanyFabric starter credits cover your first GPT-4.1 mini calls at no cost, create a free account, no card required, and the credits apply to GPT-4.1 mini and every other model on the key. When they run out, prepaid credits or BYOK (0% fee) take over with no plan to pick.
Production-grade
Code samples
import OpenAI from "openai"
const client = new OpenAI({
baseURL: "https://api.companyfabric.com/v1",
apiKey: process.env.COMPANYFABRIC_API_KEY,
})
const res = await client.chat.completions.create({
model: "openai/gpt-4.1-mini",
max_tokens: 1024,
temperature: 0.7,
messages: [{ role: "user", content: "Say hello from the fabric." }],
})
console.log(res.choices[0].message.content)Playground
Try it in the browser
Comparisons
GPT-4.1 mini vs the alternatives
GPT-4.1 mini vs GPT-6 Luna
GPT-6 Luna is OpenAI's current high-volume tier and costs less: $0.10 input and $0.50 output per million tokens, against GPT-4.1 mini's $0.40 and $1.60, with reasoning on top. GPT-4.1 mini is the one your agent may already be tuned on. Run both on the same conversations before you switch; on one key that is a one-string change.
Full comparison: GPT-4.1 mini vs GPT-6 Luna →GPT-4.1 mini vs Claude Haiku 4.5
Claude Haiku 4.5 costs more per token ($1 input and $5 output per million) and has a 200k window against GPT-4.1 mini's million. Teams usually weigh it when following instructions and calling tools reliably matters more than the price per token. Test both on your own conversations; the rate card is only half the answer.
Full comparison: GPT-4.1 mini vs Claude Haiku 4.5 →GPT-4.1 mini vs Gemini 3.5 Flash-Lite
GPT-4.1 mini and Gemini 3.5 Flash-Lite compete for the same text workloads. Both run behind the same CompanyFabric key at exact metered prices, A/B them on your real prompts and let the outputs decide, then switch with a one-line change.
Full comparison: GPT-4.1 mini vs Gemini 3.5 Flash-Lite →GPT-4.1 mini vs DeepSeek V4.1 Flash
GPT-4.1 mini and DeepSeek V4.1 Flash compete for the same text workloads. Both run behind the same CompanyFabric key at exact metered prices, A/B them on your real prompts and let the outputs decide, then switch with a one-line change.
Full comparison: GPT-4.1 mini vs DeepSeek V4.1 Flash →Compare
GPT-4.1 mini head to head
FAQ
Frequently asked questions
How much does the GPT-4.1 mini API cost?
$0.4 / M input · $1.6 / M output. Every call is metered exactly and shown before you run it.
How do I get a GPT-4.1 mini API key?
Create a CompanyFabric account, and one key unlocks GPT-4.1 mini and every other model in the library. Free starter credits are included, no subscription, no card required to try it.
Why use GPT-4.1 mini on CompanyFabric instead of going direct?
One key, one prepaid balance, and one rate-limit envelope across the whole library, at pricing at parity with or below the direct API. Model switching is a one-line change, and BYOK routing is 0% fee.
Is the API OpenAI-compatible?
Yes, point any OpenAI SDK at api.companyfabric.com/v1 and set model to "openai/gpt-4.1-mini".
Can I use the output commercially?
Commercial output use permitted per OpenAI terms.
How does billing work?
Prepaid credits via card, or BYOK with your own provider keys at 0% platform fee. No subscription required; balances never expire.
Is GPT-4.1 mini being retired?
As of 27 September 2026, OpenAI lists no shutdown date for GPT-4.1 mini. Its smaller sibling, GPT-4.1 nano, shuts down on 23 October 2026. If OpenAI announces a date for mini, this page will say so and name the replacement.
What should I move to from GPT-4.1 mini?
Within OpenAI, GPT-6 Luna is the cheaper current tier. Outside it, Claude Haiku 4.5, Gemini 3.5 Flash-Lite and DeepSeek V4.1 Flash are the usual comparisons. Test them on your own conversations before you switch; with one CompanyFabric key each is a one-string change.
Does GPT-4.1 mini support tools and vision through CompanyFabric?
Yes. Function calling, image input and streaming pass through the OpenAI-compatible endpoint unchanged.
Provider
About OpenAI
OpenAI publishes the gpt family. Also in this family: GPT-5.5, GPT-6 Astra, GPT-6 Sol, GPT-6 Luna. License: Commercial output use permitted per OpenAI terms.
Explore
Related model APIs
Claude Sonnet 4.5
$3/Mtok inAnthropic
Frontier-quality text and reasoning through one OpenAI-compatible endpoint.
text
Claude Haiku 4.5
$1/Mtok inAnthropic
Fast, cheap frontier-family model for high-volume tasks.
text
Claude Opus 4.6
$5/Mtok inAnthropic
The frontier tier for the hardest reasoning and agentic work.
text
Gemini 3.7 Flash
$0.75/Mtok inGoogle's current fast model, million-token context.
text
Gemini 3.5 Flash
$1.5/Mtok inThe previous stable Flash, still current for most work.
text
Gemini 3.1 Pro (preview)
PreviewGoogle's newest Pro tier, shipped as a preview.
text
One key. Every model. Exact prices.
Run GPT-4.1 mini with free starter credits. Free starter credits included, no subscription required.