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: "anthropic/claude-3.5-haiku-20241022",
messages: [
{
"role": "user",
"content": "Write a blog about cat."
}
]
})
console.log(completion.choices[0].message)
}
main()
Feature/Aspect | GPT-4 O Mini | Claude 3.5 Haiku | Claude 3.5 Sonnet |
---|---|---|---|
Speed | Optimized for math and science | Fastest response times | High performance with context |
Versatility | Excellent for math and programming tasks | Suitable for user-facing chatbots and data extraction | Ideal for complex problem-solving |
Context Window | 125,000 tokens | 200,000 tokens | 200,000 tokens |
Supported Inputs | Text and image | Text only | Text and image |
Specialized Tasks | Strong in various STEM tasks | Excels in coding and real-time moderation | Strong in multi-turn conversations |