Gpt 4o can only take 39 images?

Hey guys,

I am trying out things and following instructions described in the latest cookbook. I am trying to summarize a 3 minute long video, for that I am trying to send 170 frames to GPT 4o like this:

openai.chat.completions.create({
    model: 'gpt-4o',
    temperature: 0,
    messages: [
      {
        role: 'system',
        content:
          'You are a video summariser. Provided a video you provide a description of what happens in the video. Respond in text, no markup.',
      },
      {
        role: 'user',
        content: [
          { type: 'text', text: 'These are the frames from the video.' },
          ...images.map((filename) => ({
            type: 'image_url' as const,
            image_url: {
              url: `data:image/jpeg;base64,${fs
                .readFileSync(`${folderPath}/${filename}`)
                .toString('base64')}`,
              detail: 'low' as const,
            },
          })),
        ],
      },
    ],
  });

When only sending 39 images, it works as expected and uses about 3000 tokens. However when adding the 40th image, the used tokens jump up to 30000 (10x of the 39 one).

[ERROR] 18:24:18 Error: 429 Request too large for gpt-4o in organization org-REDACTED on tokens per min (TPM): Limit 30000, Requested 30643. The input or output tokens must be reduced in order to run successfully.

I am essentially trying to copy all steps from the cookbook but fail to get the same results, as the 40th image adds 27000 tokens for no reason?

Any tips are appreciated!

@fulop.dani96 Very similar to what I experience. Very frustrating :frowning: