My code below on how to pass the apiKey when using the typescript-fetch OpenAPI generator.
The apiKey is sent in the header.
Make sure your YAML openAPI configuration is set correctly.
import { Configuration, DefaultApi } from "mySDK";
const sdk = new DefaultApi(
new Configuration({
apiKey: "myApiKey",
}),
);