How to know the Jira version before calling createmeta api to get the issue types

In Jira Cloud there is old version GET /rest/api/2/issue/createmeta
https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-get that can be called with expand=projects.issuetypes.fields.

Since Jira 9.x Server/DC the old GET /rest/api/2/issue/createmeta is replaces by 2 separate methods:
GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes
GET /rest/api/2/issue/createmeta/{projectIdOrKey}/issuetypes/{issueTypeId}

Hope that helps.