How to make OpenAI API give longer responses

I’m using OpenAI API with the 4o-mini model.

I’m asking it to give me 30 ideas (using structured output: response_format={ “type”: “json_object” }).

I’m using the following text in the system_message: “You must provide at least 30 ideas, this is important.”

It never gives 30 ideas as requested, usually between 15 and 20.

I’ve tried max_tokens=20000 (and other numbers) and removing the max_tokens parameters.

The responses that I get are about 500 words long (5000 characters) and I’ve read that 4o-mini has a limit of output tokens of 16,384, so I guess there is no way I’m running out of tokens.

If I include “Count ideas” in the prompt, it gives me 30 ideas (good) but they are much shorter ideas (bad). For some reason, it doesn’t want to give very long responses, even if I include other instructions like “don’t be lazy, give long responses”.

Any ideas to solve this or at least find what is exactly the issue?