Upload media file to assets using API

How can I upload a media file into assets folder through API using API Key. Need it in CURL format.

That is not possible. The API can help you add images into collection fields which do end up in the CDN, just not the assets folder.