Why am I getting 400 MESSAGE_TOO_LONG?

Chat no longer returns MESSAGE_TOO_LONG for message. A chat message can be 10 to 100,000 characters. Over that, chat returns 400 Message too long with code CONTENT_TOO_LONG, plus maxLength and actualLength.

Last updated

If you check for MESSAGE_TOO_LONG

Check for CONTENT_TOO_LONG instead. See Why am I getting 400 CONTENT_TOO_LONG?

Fix

Send less text in message, or split it across turns with the same sessionId.