I’ve tried to use 100_000, 20_000 but seems like only 10_000 is possible:
from openai import OpenAI
client = OpenAI()
messages = {"role": "user", "content": "Hello"}
completion = client.chat.completions.create(
model="gpt-4o-mini", messages=messages,
max_tokens=10_000
)
print(completion.choices[0].message.content)
There’s the doc on https://platform.openai.com/docs/api-reference/chat/create#chat-create-max_tokens but there’s no clear indication of what’s the largest max_tokens
value possible.