import OpenAI from "openai"
const openai = new OpenAI({
baseURL: "https://api.aiapilab.com/v1",
apiKey: $AIAPILAB_API_KEY
})
async function main() {
const completion = await openai.chat.completions.create({
model: "openai/gpt-4o-mini-2024-07-18",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What's in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]
}
]
})
console.log(completion.choices[0].message)
}
main()
Feature/Aspect | GPT-4o | GPT-3.5 Turbo | OpenAI GPT-4o Mini |
---|---|---|---|
Release Date | May 13, 2024 | March 14, 2023 | July 18, 2024 |
Context Window | 128,000 tokens | 8,192 tokens | 128,000 tokens |
Input Modalities | Text, images, audio, and video | Text (limited image handling) | Text and images |
Output Modalities | Text and vision | Text | Text |
MMLU Benchmark Score | Higher than GPT-4 | 69.8% | 82% |