Nov 21 (Reuters) - WeWork said on Tuesday it had secured commitments for up to $682.5 million in debtor-in-possession financing from some of its lenders, weeks after the shared office space provider filed for bankruptcy protection.

The SoftBank-backed company is seeking to address more than $4 billion in debt and unsustainable future rent costs through a bankruptcy plan.

WeWork, once the most valuable U.S. startup, struggled to achieve profitability as a rise in work-from-home trends following the pandemic soured demand for its shared office spaces.

In a regulatory filing, WeWork disclosed it had entered into a commitment letter on Nov. 15 with parties including Goldman Sachs International Bank, JPMorgan Chase Bank and SoftBank Vision Fund 2.

The financing could be as much as $682.5 million but it could also be smaller than that depending on other conditions, WeWork said, adding that the parties have agreed to provide the financing individually and not jointly.

The company also said the financing agreement was dependent on fulfilling certain conditions, including the approval of the Bankruptcy Court.

WeWork entered bankruptcy with about $164 million of cash on hand, according to court filings.

(Reporting by Bhanvi Satija in Bengaluru; Editing by Devika Syamnath)