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",
messages: [
{
"role": "user",
"content": "Write a blog about cat."
}
]
})
console.log(completion.choices[0].message)
}
main()
Feature/Aspect | Claude 3.5 Haiku | Claude 3.5 Sonnet |
---|---|---|
Model Type | Fastest model | Most intelligent model |
Context Window | 200,000 tokens | 200,000 tokens |
Max Output Tokens | 8,192 tokens | 8,192 tokens |
Primary Strengths | Speed, coding accuracy, and real-time applications | Advanced reasoning, coding, and tool use |
Image Input Capability | No | Yes |