
<PAGE>
 
                                                                     Exhibit 5.1
                        [Letterhead of Gable & Gotwals
                          A Professional Corporation]



                                April 15, 1999



ONEOK, Inc.
100 West Fifth Street
Tulsa, OK 74103-4298

     Re:  Form S-3, Registration Statement Under the Securities
          Act of 1933, relating to certain Debt Securities

Gentlemen:

     We are retained as regular counsel for ONEOK, Inc., an Oklahoma corporation
(hereinafter called the "Company") which has filed with the Securities and
Exchange Commission under the Securities Act of 1933, as amended, a Registration
Statement on Form S-3 (including a Prospectus) relating to the registration of
unsecured debentures, notes, bonds or other evidence of indebtedness (the
"Securities") which may be offered as one or more separate series or as a single
series, as determined at the time of the offering.

     We have examined (a) the above-mentioned Registration Statement which is
being filed with the Securities and Exchange Commission; (b) the Indenture (the
"Indenture") entered into between the Company and the Trustee; (c) the
Certificate of Incorporation, as amended, and the By-laws, as amended, of the
Company; (d) the corporate actions taken by the Board of Directors of the
Company in connection with the issuance and sale of the Securities; and (e) such
other corporation records, certificates of public officials and officers of the
Company, and other documents as we have considered relevant to the matters
covered by this opinion.

     In connection with the foregoing, we wish to advise you as follows:

     1.   The Company is a corporation validly organized and existing under the
laws of the State of Oklahoma and is duly qualified to do business as a foreign
corporation in the State of Kansas.

     2.   The filing of the above-mentioned Registration Statement and the
execution of the above-mentioned Indenture have been duly authorized by the
proper corporate action on the part of the Company.

     3.   When a series of Securities has been duly issued pursuant to the terms
and conditions of the Indenture, such Securities shall be legally issued, fully
paid, and non-assessable obligations of the Company in the hands of the then
owners thereof and such Securities shall be valid, legal and binding obligations
of the Company enforceable in accordance with their terms, except as such
<PAGE>
 
ONEOK, Inc.
April 15, 1999
Page 2


enforcement may be limited by bankruptcy, insolvency, reorganization or other
laws of general application relating to or affecting creditors' rights and to
general equity principles.

     We hereby consent to:

     1.   Being named in the above Form S-3 Registration Statement and the
Prospectus which is being made a part thereof, and in any amendments thereto,
under the caption "Legal Matters," as counsel for the Company, passing upon
legal matters in connection with the Securities and having reviewed the matters
of law and legal conclusions under "Description of Securities" contained in said
Prospectus which are included therein under our authority as experts.

     2.   The filing of this opinion as an exhibit to the above-mentioned Form 
S-3 Registration Statement.

                                    Very truly yours,



                                    Donald A. Kihle
                                    For the Firm

DAK:jh
