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/o1-preview",
messages: [
{
"role": "user",
"content": "Write a blog about cat."
}
]
})
console.log(completion.choices[0].message)
}
main()
Feature/Aspect | GPT-4 O | OpenAI o1-mini | OpenAI o1-preview |
---|---|---|---|
Use Cases | Versatile but not specialized for reasoning-intensive tasks | Best for quick coding tasks and simpler queries | Ideal for scientific research, advanced coding, and complex mathematical problems |
Context Length | Supports up to 8k tokens | Supports up to 128k tokens | Supports up to 128k tokens |
Performance in Math | Lower performance in complex math tasks | Good at basic math problems | 83% success rate in mathematics olympiad qualifying exams |
Reasoning Capability | Good reasoning but less advanced than o1 models | Simplified reasoning; faster but less capable than o1-preview | Advanced chain-of-thought reasoning; excels in complex problem-solving |
Performance in Coding | Competent coding but less effective than o1 models | Good coding capabilities, faster response times | 89th percentile in coding competitions; generates and optimizes code effectively |