Is it possible to have an API that is used by both a SPA application and a M2M service?

Because the SPA needs the audience to be the ClientId and the M2M service needs the audience to be the audience of the API.