the invention relates to a method of producing polyester imides of the formula ## str1 ## by reacting tetracarboxylic acid dianhydrides of the formula ## str2 ## with n , n &# 39 ;- bisdicarboxylic acid diamides of the formula , ho -- z -- nh -- co -- b -- co -- nh -- z -- oh , where a represents a quadrivalent aromatic group with 6 - 32 c atoms , wherein up to 40 % of a may be replaced by a quadrivalent aliphatic group with up to 16 c atoms , b represents a divalent aliphatic or aromatic group with up to 14 c atoms , z represents an alkylene group with 2 - 3 c atoms , and n is a number from 3 to 500 .