In previous article I have explained how to create an API with Bicep. But APIs in APIM goes towards versioning and then endpoints.
If you do not intend to use versioning, you can create API in the last step of the previous article. Otherwise you need to define a version set first.
Here I am using the Segment as the versioning scheme. You can opt to use the Query String or a header as well instead.