Back to Models
openai logoOpenAI
gpt-4o-mini

GPT-4o-mini

GPT-4o mini is OpenAI's newest model after [GPT-4 Omni](/models/openai/gpt-4o), supporting both text and image inputs with text outputs. As their most advanced small model, it is many multiples more affordable than other recent frontier models, and more than 60% cheaper than [GPT-3.5 Turbo](/models/openai/gpt-3.5-turbo). It maintains SOTA intelligence, while being significantly more cost-effective. GPT-4o mini achieves an 82% score on MMLU and presently ranks higher than GPT-4 on chat preferences [common leaderboards](https://arena.lmsys.org/). Check out the [launch announcement](https://openai.com/index/gpt-4o-mini-advancing-cost-efficient-intelligence/) to learn more. #multimodal

7/18/2024
128,000 tokens
Input: $0.1583/M
Output: $0.633/M

Specifications

Modalities

Input
text
image
file
Output
text

Supported Parameters

frequency_penalty
logit_bias
logprobs
max_tokens
presence_penalty
response_format
seed
stop
structured_outputs
temperature
tool_choice
tools
top_logprobs
top_p
web_search_options

Max Output Tokens

16,384

Data policy

Prompt retention
Unknown — we could not confirm
Training
Not used for training

"Unknown" does not mean "safe". It means we could not confirm it.

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)1.3s
Throughput (p50)124 tokens/s

    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-4o-mini",
        "messages": [{"role": "user", "content": "Hello!"}]
      }'

    How GPT-4o-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.

    To count the number of 'r's in the word "strawberry," we can follow these steps: 1. **Identify the word**: We have the word "strawberry." 2. **Break down the letters**: Let's write out the letters in the word: - s - t - r - a - w - b - e - r - r - y 3. **Locate the 'r's**: Now, we need to look for the letter 'r' among these letters. - In the list of letters, we can see: - The first 'r' is in the 3rd position. - The second 'r' is in the 8th position. - The third 'r' is in the 9th position. 4. **Count the occurrences**: We check each position we identified: - There are three occurrences of 'r' in the word "strawberry." 5. **Conclusion**:…
    2.1s response239 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 you're encountering, `TypeError: Cannot read properties of undefined (reading 'map')`, indicates that the `users` prop is `undefined` when you try to call the `map` method on it. In your `UserList` component, you're attempting to use `users.map(...)`, but if the `users` prop is not provided or is `undefined`, this will throw an error. ### Fixing the Error 1. **Default Props**: You can set a default value for the `users` prop to prevent the error when it is `undefined`. ```jsx function UserList({ users = [] }) { // Default to an empty array return ( <ul> {users.map(user => <li key={user.id}>{user.name}</li>)} </ul> ); } ```…
    5.0s response511 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 Python function, `get_data`, essentially performs a GET request, handles retries on failure, and processes the response JSON to return a filtered list of dictionaries. Below, I've highlighted several improvements regarding readability, performance, and best practices: 1. **Avoid blanket exceptions**: It’s best practice to specify which exceptions you expect, allowing for better debugging and error handling. 2. **Use `requests` built-in exception handling**: Handle specific requests exceptions, such as `requests.exceptions.RequestException`. 3. **Improve condition checks**: Check for `item['active']` directly instead of comparing to `True`, which is more Pythonic. 4. **Use `time.sl…
    8.8s response628 output tokens

    Compare these answers side by side with other models →

    Frequently asked questions

    How much does the GPT-4o-mini API cost?
    On FastMetal, GPT-4o-mini is billed per token: $0.1583 per 1M input tokens and $0.633 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-4o-mini with the OpenAI SDK?
    Yes. Point base_url at https://api.fastmetal.ai/v1 and pass "gpt-4o-mini" as the model; existing OpenAI-style code works unchanged, including streaming, tool calls and structured output.
    What is the context window of GPT-4o-mini?
    128,000 tokens, shared between the prompt and the response.
    What do I need to try GPT-4o-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-4o-mini right now

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