Here's the commandline I use to generate my API calls:
nswag swagger2tsclient /input:swagger.json /output:./gen/index.ts /ExtensionCode:./base/extension.ts /ClientBaseClass:BaseClient /UseGetBaseUrlMethod:true /GenerateOptionalParameters:true
However, this won't generate API client with fetch including credential options I I have to manually set it.
After google for several days, I still couldn't find how to set.