Manual:$wgAPIMaxResultSize

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

Don't set this lower than  .