Are there any APIs to get the version of telegraf in the outputs/inputs plugins?

are there any APIs to get the version of telegraf in the outputs/inputs plugins?

No, there is nothing like this.