Can an API be Grafana Datasource?

I am streaming my cloudwatch metrics to AWS open search using Kinesis firehose. My plan is to plot the data on grafana after doing some additional math on the metrics. Is it possible to pull the data from Opensearch to an endpoint, process (math/transformation), and then feed to Grafana (endpoint can be an API)?

Yep, this could work if you expose your data on an accessible endpoint as JSON. Consider using this data source plugin for that: