#Novita: max_tokens (current value: 33437) must be between 0 and 20000

9 messages · Page 1 of 1 (latest)

broken pier
#

I am getting this error when call chat completion with the model "qwen/qwen3-235b-a22b".

The full error is

{"error":{"message":"Provider returned error","code":400,"metadata":{"raw":"{"code":400, "reason":"INVALID_REQUEST_BODY", "message":"max_tokens (current value: 33437) must be between 0 and 20000 ", "metadata":{}}","provider_name":"Novita"}},"user_id":"user_2wo6L6Kv2z9P2N53dn9ylN7kHFr"}

broken pier
#

@arctic abyss Please help

burnt shadow
#

It's asking you to set your max_tokens lower (this refers to how much it's allowed to output).

broken pier
#

I did not set anything in this value. I think it is the default set by OpenRouter

warm timber
#

Depending on the provider, the maximum number of tokens that can be output may vary.

#

Please read the document link I attached and set the max_tokens value explicitly.

#

example: 'max_tokens = 20_000;'