You can add a mutator function to your config and setup a custom instance of your prefered HTTP client.
module.exports = {petstore: {output: {...override: {mutator: {path: './api/mutator/custom-instance.ts',name: 'customInstance',},},}...},};
// custom-instance.tsconst baseURL = '<BACKEND URL>'; // use your own URL here or environment variableexport const customInstance = async <T>({url,method,params,data,}: {url: string;method: 'get' | 'post' | 'put' | 'delete' | 'patch';params?: any;data?: any;responseType?: string;}): Promise<T> => {const response = await fetch(`${baseURL}${url}` + new URLSearchParams(params),{method,...(data ? { body: JSON.stringify(data) } : {}),},);return response.json();};export default customInstance;