Unexpected High Token Usage on OpenAI API

Hi I’m experiencing an unusual token usage situation and seeking insights.

Current Usage Status:

  • Dashboard total tokens: 77,720
  • Input tokens: 77,056
  • Output tokens: 664

Actual API Requests (curl commands):

  1. First Chat Completion Request:
curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer [REDACTED]" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Analyze the image and extract a prompt ..."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "..."
            }
          }
        ]
      }
    ],
    "max_tokens": 300
  }'
  1. Second Chat Completion Request:
curl https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer [REDACTED]" \
  -d '{
    "model": "gpt-4o-mini",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "Analyze the image and extract a prompt ..."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "..."
            }
          }
        ]
      }
    ],
    "max_tokens": 300
  }'

Observations:

  • Actual logged requests are significantly lower than reported usage
  • Requests were primarily chat completions
  • Each request averaged around 1,000 tokens

Questions for Community:

  • Has anyone experienced similar unexpected token consumption?
  • Are there known billing quirks with recent API updates?
  • Recommendations for accurate usage tracking?

Appreciate any insights or experiences you can share.

Welcome to the community!

This has been a very common point of confusion.

The problem is that you’re using the mini model.

Here’s an authoritative source.

I couldn’t find it mentioned anywhere in pricing (https://openai.com/api/pricing/) - the only way you could potentially figure it out if you use their vision pricing calculator, and then back-calculate the tokens from that.

The cost calculation in the api doc (https://platform.openai.com/docs/guides/vision#calculating-costs) seem to be completely irrelevant :confused:

1 Like