Exhibit 5.1

November 20, 2018
ONEOK, Inc.
100 West Fifth Street
Tulsa, Oklahoma 74103
| Re: | Registration Statement on FormS-8 |
Ladies and Gentlemen:
We have acted as special legal counsel to ONEOK, Inc., an Oklahoma corporation (the “Company”), in connection with the registration statement on FormS-8 (the “Registration Statement”) under the Securities Act of 1933, as amended (the “Act”), covering an additional 1,000,000 shares of the common stock of the Company, par value $0.01 per share (the “Shares”), under the ONEOK, Inc. 401(k) Plan (the “Plan”). This opinion is being furnished to you as a supporting document in connection with the Registration Statement.
For purposes of this opinion, we have examined the following documents:
(a) the Registration Statement;
(b) the Plan;
(c) the corporate actions taken by the Board of Directors of the Company in connection with the Registration Statement and related matters;
(d) the Amended and Restated Certificate of Incorporation of the Company, as amended, and the related certificate of correction;
(e) the Amended and RestatedBy-laws of the Company; and
(f) an executed copy of the Secretary’s Certificate of the Company dated November 20, 2018.
In our examination of the aforesaid documents, we have assumed the genuineness of all signatures, the legal capacity of all natural persons, the authenticity and completeness of all documents submitted to us as original documents, and the conformity to original documents of all documents submitted to us as copies thereof.