Can not access to o1 for vision task

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?

Yes.

  1. Were you to have access to the o1 series of models, that timeout would disconnect and throw an error long before the model could return a reasoning response to you, especially with an image.

  2. The image_url field is a data URL, not simply the base64 data alone, as you can clearly see here:

import base64,openai;print(openai.Client().chat.completions.create(**{"model":"gpt-4o","messages":[{"role":"system","content":"Vision assistant"},{"role":"user","content":[{"type":"text","text":"Describe image"},*([{"type":"image_url","image_url":{"url":(f"data:image/{__import__('pathlib').Path(f).suffix[1:]};base64,{base64.b64encode(__import__('pathlib').Path(f).read_bytes()).decode()}"),"detail":"low"}}for f in["i.png"]])]}],"max_completion_tokens":100}).choices[0].message.content)

  1. There also is nothing to think hard about in an image that a model like gpt-4o-2024-11-20 can’t do at a lower price, unless it is “solve this visual puzzle that no other AI can perform well on”.

Then of course finally: why don’t you have access?

Only a subset of accounts have access. Use the API models endpoint or the Prompt Playground and see it not available there either.

https://help.openai.com/en/articles/10362446-api-access-to-o1-and-o3-mini