How to change allocated AWS lambda memory depending on the API request/ or the handler

Basically I need to be cost efficient with AWS, I have a large nodejs/express application wrapped in a docker container. But only 2 apis out of 200 need a hefty amount of memory from aws lambda. The other apis barely need any so I want to know if there is a way to change the allocated memory depending on the request. Or if I need to split the application into multiple aws lambda functions.