API stands for Application Programming Interface which is a middleware (more specifically an application programming interface) that makes it possible for applications to interact with each other without any difficulty or error. SDK is a set of tools that make it possible for users to directly develop their own applications on a certain platform.
Essentially, both SDKs and APIs are tools to connect software together. However, API is essentially just an application programming interface, meaning that users will have to develop their own applications from A to Z.
And the SDK is a provision of available tools, users only rely on it to customize the application at their own discretion. An SDK can include multiple APIs, and within it will be provided tools to help develop and use the API.