Back to Models
openai logoOpenAI
gpt-4.1-mini

GPT-4.1 Mini

GPT-4.1 Mini is a mid-sized model delivering performance competitive with GPT-4o at substantially lower latency and cost. It retains a 1 million token context window and scores 45.1% on hard instruction evals, 35.8% on MultiChallenge, and 84.1% on IFEval. Mini also shows strong coding ability (e.g., 31.6% on Aider’s polyglot diff benchmark) and vision understanding, making it suitable for interactive applications with tight performance constraints.

4/14/2025
1,047,576 tokens
Input: $0.44/M
Output: $1.76/M

Specifications

Modalities

Input
image
text
file
Output
text

Supported Parameters

max_tokens
response_format
seed
structured_outputs
temperature
tool_choice
tools
top_p

Max Output Tokens

32,768

Data policy

Prompt retention
May be retained
Training
Not used for training

Whether a provider trains on prompts is a declared value from our terms with them. Retention is determined from the upstream listing for every host this model can reach. Neither is guessed.

Measured performance

Time to first response (p50)756ms
Throughput (p50)159 tokens/s
  • Routed across 2 independent backends

Measured through FastMetal's own gateway over the last 30 days (661 first-response samples).

Throughput is sampled once a day: the median of 27 observations over the last 30 days.

Time to first response is measured to the first streamed chunk; throughput counts all output tokens, including reasoning tokens. These are observations, not a performance guarantee.

Code Examples

curl https://api.fastmetal.ai/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-4.1-mini",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

How GPT-4.1 Mini actually answers

Real responses to our standard prompts, recorded on FastMetal.

Count the number of 'r's in 'strawberry'

Count the number of 'r's in 'strawberry'. Explain your reasoning step by step.

Let's count the number of 'r's in the word "strawberry" step by step: 1. Write down the word: s t r a w b e r r y 2. Look at each letter and check if it is 'r': - s → not 'r' - t → not 'r' - r → yes, 1st 'r' - a → not 'r' - w → not 'r' - b → not 'r' - e → not 'r' - r → yes, 2nd 'r' - r → yes, 3rd 'r' - y → not 'r' 3. Total number of 'r's found: 3 **Answer:** There are 3 'r's in the word "strawberry".
2.0s response176 output tokens

Debug This Error

I'm getting the following error in my Node.js application: TypeError: Cannot read properties of undefined (reading 'map') at UserList (/app/components/UserList.js:12:25) at renderWithHooks (/app/node_modules/rea…

The error **"TypeError: Cannot read properties of undefined (reading 'map')"** means that the `users` prop passed to your `UserList` component is `undefined` at the time the component tries to render, so calling `.map()` on it throws an error. ### What's causing the error? - Your component expects `users` to be an array, but for some reason it is `undefined` when the component renders. - This could happen if: - The parent component that passes the `users` prop did not pass it or passed `undefined`. - The data is being fetched asynchronously and hasn't arrived yet. - The default prop is missing or no default fallback is handled. ### How to fix it? You want to ensure `users` is alway…
8.1s response465 output tokens

Code Review

Please review the following Python function and suggest improvements for readability, performance, and best practices: def get_data(url, retries=3): import requests import time for i in range(retries):…

Your function is functional but can be improved for readability, performance, and best practices. Here are some suggestions and an improved version of your function: ### Issues and improvements 1. **Imports**: Import at the top of the file rather than inside the function. 2. **Catch specific exceptions**: Avoid bare `except:` clauses. Catch specific exceptions like `requests.RequestException` or `json.decoder.JSONDecodeError`. 3. **Use list comprehension**: Instead of a loop with `append()`, use list comprehension for clarity and conciseness. 4. **Check boolean conditions directly**: Instead of `item["active"] == True`, just use `item["active"]`. 5. **Avoid sleeping after last retry**: No…
5.6s response690 output tokens

Compare these answers side by side with other models →

Frequently asked questions

How much does the GPT-4.1 Mini API cost?
On FastMetal, GPT-4.1 Mini is billed per token: $0.44 per 1M input tokens and $1.76 per 1M output tokens on a US-dollar account, before tax. Usage is drawn from a prepaid balance; there is no subscription or monthly fee.
Can I call GPT-4.1 Mini with the OpenAI SDK?
Yes. Point base_url at https://api.fastmetal.ai/v1 and pass "gpt-4.1-mini" as the model; existing OpenAI-style code works unchanged, including streaming, tool calls and structured output.
What is the context window of GPT-4.1 Mini?
1,047,576 tokens, shared between the prompt and the response.
What do I need to try GPT-4.1 Mini?
Create an account and add credit; the model is then available both in the browser chat and over the API. There is no contract or minimum spend.

Try GPT-4.1 Mini right now

GPT-4.1 Mini is available on FastMetal through one API key. Start in the browser, or call it from the OpenAI SDK.