This is my code to access the api:
const promptBody = {
"model": "o1-2024-12-17",
"input": [
{
"role": "user",
"content": [
{ "type": "input_text", "text": "" },
{
"type": "input_image",
"image_url": ""
}
]
}
]
};
if (textPrompt) {
promptBody.input[0].content[0].text = textPrompt
}
if (imageBase64) {
promptBody.input[0].content[1].image_url = imageBase64
}
if (messages.length === 0) {
throw new Error('Either textPrompt or imageBase64 is required');
}
const payload = promptBody
// Generate a unique request ID
const requestId = `req_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
// Start progress simulation for OpenAI
pollStatusOpenAI(clientId, requestId);
// Send request to OpenAI
const response = await axios.post(openaiUrl, payload, {
headers: {
'Authorization': `Bearer ${openaiApiKey}`,
'Content-Type': 'application/json'
},
timeout: 10000 // 10-second timeout
});
When I send the request, I receive this error message:
404 The model o1-2024-12-17
does not exist or you do not have access to it.
Is there anything wrong with my request?