Manual:$wgAPIMaxResultSize/cs

Details
The maximum size (in bytes) of an API result.

Don't set this lower than.