About the long request

I’m using Cursor with api based pricing model, but in Claude Sonnet 3.7 it can’t generate long codes and a red x appears. Is there a solution for this?