EX-5.1 2 ea022389302ex5-1_oneok.htm OPINION OF GABLEGOTWALS REGARDING THE VALIDITY OF THE SECURITIES BEING REGISTERED

Exhibit 5.1

110 North Elgin Avenue, Suite 200 Tulsa, Oklahoma 74120 Telephone (918) 595-4800 Fax (918) 595-4990 www.gablelaw.com | BOK Park Plaza 499 West Sheridan Avenue, Suite 2200 Oklahoma City, Oklahoma 73102 Telephone (405) 235-5500 Fax (405) 235-2875 | 1100 Louisiana, Suite 5000 Houston, Texas 77002 Telephone: (346) 200-6020
| December 26, 2024 |

ONEOK, Inc.

100 West Fifth Street

Tulsa, Oklahoma 74103

| Re: | Registration Statement on Form S-4; Issuance of 41,032,926 shares of common stock, par value $0.01 per share of ONEOK, Inc.

Ladies and Gentlemen:

We have acted as special counsel to ONEOK, Inc., an Oklahoma corporation (the “Company”), in connection with the proposed issuance by the Company of 41,032,926 shares of its common stock, par value $0.01 per share (the “Shares”), pursuant to the terms and conditions of the Agreement and Plan of Merger, dated as of November 24, 2024 (the “Merger Agreement”), by and among the Company, Elk Merger Sub I, L.L.C., a Delaware limited liability company, Elk Merger Sub II, L.L.C., a Delaware limited liability company, EnLink Midstream, LLC, a Delaware limited liability company, and EnLink Midstream Manager, LLC, a Delaware limited liability company. The Shares are included in a registration statement on Form S-4 under the Securities Act of 1933, as amended (the “Act”), initially filed with the Securities and Exchange Commission (the “Commission”) on December 9, 2024, (as amended from time to time, the “Registration Statement”). This opinion is being furnished in connection with the requirements of Item 601(b)(5) of Regulation S-K under the Act, and no opinion is expressed herein as to any matter pertaining to the contents of the Registration Statement or related Prospectus, other than as expressly stated herein with respect to the issuance of the Shares.

As such counsel, we have examined such matters of fact and questions of law as we have considered appropriate for purposes of this letter. With your consent, we have relied upon certificates and other assurances of officers of the Company and others as to factual matters without having independently verified such factual matters. We are opining herein as to the Oklahoma General Corporation Act, as amended (the “Oklahoma Act”), and we express no opinion with respect to any other laws.

Subject to the foregoing and the other matters set forth herein, it is our opinion that, as of the date hereof, upon issuance and delivery in the manner contemplated by the Registration Statement and the Merger Agreement, the Shares will be validly issued, fully paid and non-assessable.

| ONEOK, Inc. December 26, 2024 Page 2

This opinion is for your benefit in connection with the Registration Statement and may be relied upon by you and by persons entitled to rely upon it pursuant to the applicable provisions of the Act. We consent to your filing this opinion as an exhibit to the Registration Statement and to the reference to our firm in the Registration Statement under the heading “Legal Matters.” In giving such consent, we do not thereby admit that we are in the category of persons whose consent is required under Section 7 of the Act or the rules and regulations of the Commission thereunder.

| Yours very truly,
| /s/ GableGotwals