OpenAI: GPT-4o-mini (2024-07-18)

openai/gpt-4o-mini-2024-07-18

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

Pricing

Price per input token: $0.00000015

Price per output token: $0.0000006

Usage Example

NOTE: BrainLink is compatible with the OpenAI API, which allows you to use the OpenAI SDK even with non-OpenAI models

import OpenAI from "openai";
const userAccessToken = await BrainLink.getUserToken();
const openai = new OpenAI({
    baseURL: "https://www.brainlink.dev/api/v1",
    apiKey: userAccessToken,
});
const completion = await openai.chat.completions.create({
    model: "openai/gpt-4o-mini-2024-07-18",
    messages: [
      { role: "user", content: "Hi! How are you today?" }
    ],
});