AI EngineerGuide

max_tokens isn’t compatible with OpenAI o-series models

Rejected Applies to o1*, o3*, o4* on the OpenAI Chat Completions.

OpenAI's docs describe this error but don't quote the exact message, so we don't either.

How to fix it

Use max_completion_tokens instead of max_tokens.

Before
{
  "max_tokens": 500,
  "messages": [
    {
      "content": "Summarize this ticket.",
      "role": "user"
    }
  ],
  "model": "gpt-4o-2024-08-06"
}
After (o3)
{
  "max_completion_tokens": 500,
  "messages": [
    {
      "content": "Summarize this ticket.",
      "role": "user"
    }
  ],
  "model": "o3"
}

Official source

This value is now deprecated in favor of max_completion_tokens, and is not compatible with o-series models.

https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create (last checked 2026-11-02)

All migration errors

FAQ

How do I fix this when moving to o1*, o3*, o4*?

Use max_completion_tokens instead of max_tokens.

Where is this documented?

In OpenAI’s official docs: https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create, last checked 2026-11-02.