<PAGE>   1

                                                                  EXHIBIT 10(i)



                                AMENDMENT NO. 2
                                       TO
                                CREDIT AGREEMENT
                        DATED MARCH 29, 1996, AS AMENDED

                  AMERICAN PRECISION INDUSTRIES INC. ("Company") and
MARINE MIDLAND BANK ("Bank") are parties to a Credit Agreement
dated March 29, 1996 as amended August 27, 1996 ("Credit
Agreement").

RECITALS:
---------

                  1. Company is implementing a corporate reorganization whereby
new subsidiaries have been, or are being, created to conduct various aspects of
the Company's business in integrated business units.

                  2. In order to provide adequate working capital and other
funding of the Company's subsidiaries, the Company has requested that the Bank
increase the Commitment under the Credit Agreement from the present $16,000,000
to $20,000,000 in the aggregate.

                  3. Bank is willing to so increase the Commitment on the
conditions and terms hereinafter set forth.

                  4. Capitalized terms not otherwise defined herein have the
meanings defined in the Credit Agreement.

                  NOW, THEREFORE, for a good and valuable consideration the
receipt of which is hereby acknowledged, the parties agree as follows:

         A.       CONDITIONS.  The Amendments set forth below shall
become effective on the date when the Bank receives all of the
following documents in form and content satisfactory to the
Company and the Bank ("Effective Date"):

                  1. The Replacement Revolving Note (as defined in B.2 below)
dated the Effective Date and executed by the Company and with all blanks
appropriately completed.

                  2. A favorable counsel opinion from Jaeckle Fleischmann &
Mugel LLP in form and content satisfactory to Bank and its counsel, dated as of
the Effective Date, as to, among other things, the due authorization, execution
and delivery of (i) this Agreement and the Replacement Revolving Note by the
Company, and (ii) the Guaranties by the Guarantors; the good standing and
authority to transact their business of the Company and the Guarantors; that
there are no violations of the Company's organization documents, other material
agreements, or any law or


<PAGE>   2


                                     - 2 -


court decree, and no material litigation or any litigation questioning the
validity of the Credit Agreement, this Agreement, the Revolving Note or the
Replacement Revolving Note; that no consent, filing, license, authorization,
registration or filing is required with any court or governmental authority in
connection with the execution and performance of this Agreement, the Guaranties
or the Replacement Revolving Note; and such other matters as the Bank or its
counsel may reasonably request.

                  3. Within thirty (30) days of the date of Amendment No. 2 to
Credit Agreement dated March 29, 1996, as amended the following:

                                    A. Guaranties in form and substance
                           satisfactory to the Bank from each of the following
                           entities of the indebtedness of the Company to Bank
                           and of any indebtedness of any of their subsidiaries
                           to Bank in the respective amounts set forth below
                           for each such entity:
<TABLE>
<CAPTION>

                                    Guarantor                                 Amount
                                    ---------                                 ------

                                   <S>                                        <C>        
                                    API Heat Transfer Inc.                    $17,180,000
                                    API Motion Inc.                           $ 6,600,000
                                    API Electronic Components Inc.            $ 3,885,000
</TABLE>

                                    B. Guaranties from each of the following
                           entities of the indebtedness of the Company to Bank
                           in the amounts set forth below for each such entity:
<TABLE>
<CAPTION>

                                    Guarantor                             Amount
                                    ---------                             ------

                                   <S>                                    <C>       
                                    API Basco Inc.                        $4,850,000
                                    API Airtech Inc.                      $  750,000
                                    API Ketema Inc.                       $5,250,000
                                    API Controls Inc.                     $1,100,000
                                    API Deltran Inc.                      $1,000,000
                                    API Gettys Inc.                       $2,200,000
                                    API Harowe Inc.                       $2,300,000
                                    API Delevan Inc.                      $1,050,000
                                    API SMD Inc.                          $1,500,000
</TABLE>



<PAGE>   3


                                     - 3 -


         B.       AMENDMENTS
                  ----------

                  From and after the Effective Date, the Credit Agreement is
amended as follows:

                  1. The existing definition of "Note" or "Notes" set forth in
Section 1.1 of the Credit Agreement is hereby deleted and the following is
substituted in its place:

                           "'Note' or 'Notes' - the Revolving Note and/or
                           Term Note, as appropriate, and, from after the
                           Effective Date of Amendment No. 2 to this
                           Agreement, the Replacement Revolving Note."

                  2. The following definition is added to Section 1.1 of the
Credit Agreement between the existing definitions of "Release" and "Reportable
Event":

                           "'Replacement Revolving Note' - the promissory
                           note of the Company in the form of Exhibit A-1 to
                           Amendment No. 2 to Credit Agreement dated
                           March 29, 1996, as amended."

                  3. The existing definition of "Revolving Credit" set forth in
Section 1.1 of the Credit Agreement is hereby deleted and the following is
substituted in its place:

                           "'Revolving Credit' - the aggregate sum made
                           available to the Company up to the amount of the
                           Commitment pursuant to the provisions of Section
                           2.1(a) of this Agreement."

                  4. Section 2.1(a) of the Credit Agreement is hereby amended
to delete the sum "Sixteen Million Dollars ($16,000,000)" from the ninth line
thereof, and substitute the following as the amount of the "Commitment":

                           "Twenty Million Dollars ($20,000,000)".

                  5. The following new Section 2.1(d) is added to the Credit
Agreement:

                           "(d) REPLACEMENT REVOLVING NOTE.  From and after
                           the Effective Date of Amendment No. 2 to Credit
                           Agreement dated March 29, 1996, as amended, the
                           Advances made by the Bank under this Agreement
                           shall be evidenced by the Replacement Revolving
                           Note with all blanks appropriately completed, and
                           executed by the Company and delivered to the Bank.



<PAGE>   4


                                     - 4 -


                           The Replacement Revolving Note shall be inscribed by
                           the Bank as holder thereof on the schedule on the
                           reverse side thereof or any continuation thereof
                           ('Schedule') with the date and amount of the
                           outstanding principal balance of the Advances, the
                           Rate Option applicable to such Advances, the
                           applicable interest periods, and all payments and
                           prepayments made thereon and the dates thereof. Any
                           such inscription shall constitute prima facie
                           evidence of the accuracy of the information so
                           recorded; provided, however, the failure of the Bank
                           to make any such inscription shall not affect the
                           Company's obligations under the Replacement
                           Revolving Note or this Agreement."

                  6.       Sections 2.2 and 2.3 of the Credit Agreement are
amended as follows:

                           "All existing references to 'Revolving Note' are
                           changed to read 'Replacement Revolving Note'."

                  7. Section 6.3 of the Agreement is hereby revised to add the
following new items (iv) and (v) to the list of excepted Liens consented to by
the Bank:

                           "(iv) existing Liens in trade receivables of
                           Schmidt-Bretten GmbH granted to Sparkane Bruchsal-
                           Bretten Bank to secure a line of credit for DM
                           3,000,000; and

                           (v) existing Liens on property of Portescap SA
                           pledged as security for long-term mortgage loans
                           amounting to CH 11,439,000."

                  8. The following is added to Section 6.12 of the Agreement:

                           "For purposes of computing the Company's Debt-to-
                           Tangible Net Worth Ratio, the Company's existing
                           20,000 Series A Shares of convertible preferred
                           shares issued to Inter Scan Holding Ltd. ("Inter
                           Scan"), and the $5,000,000 Exchangeable Promissory
                           Note dated July 8, 1997 issued by the Company to
                           Inter Scan shall not be deemed Liabilities and will
                           be deemed a part of Net Worth until the earlier of
                           April 30, 1998 or the date on which the Company's
                           Board of Directors and shareholders approve of an
                           amendment to the Company's certificate of
                           incorporation authorizing the Series B Seven Percent
                           Cumulative Convertible Preferred Stock, $21.15625
                           face value and


<PAGE>   5


                                     - 5 -


               liquidation value per share and such amendment is
                   duly filed with the Secretary of State of
                                   Delaware."

                  9. Section 6.9 of the Agreement is replaced in its entirety
by the following:

                           "6.9  LEASE RENTALS.  Pay rentals under any
                           operating or true leases which are not capitalized
                           on the Company's books in excess of $2,000,000 in
                           the aggregate during any fiscal year."

         C.       REPRESENTATIONS AND WARRANTIES
                  ------------------------------

                  1. The Company hereby represents and warrants to the Bank
that the representations and warranties of the Company made pursuant to the
Credit Agreement are true in all material respects on and as of the date hereof
as if made on and as of said date.

                  2. No Event of Default exists under the Credit Agreement, and
no event or condition has occurred which, but for the requirements of notice or
lapse of time or both, would constitute an Event of Default under the Credit
Agreement.

                  3. The making and performance by the Company of this
Amendment have been duly authorized by all required corporate and shareholder
action.

                  4. The delivery by the Company on the Effective Date of the
Replacement Revolving Note and the Guaranties shall constitute a further
representation and warranty by the Company that the representations and
warranties contained herein are true in all material respects on and as of the
Effective Date.

         D.       REAFFIRMATION
                  -------------

                  The Credit Agreement, except as specifically modified by this
Amendment, shall remain in full force and effect and the Company hereby
reaffirms the granting and effectiveness of the Credit Agreement as modified by
this Amendment and all prior amendments and all other documents executed and
delivered to the Bank in connection with the Credit Agreement.

         E.       OTHER PROVISIONS
                  ----------------

                  1. This Amendment may be executed in any number of
counterparts and by the parties hereto on separate counterparts, each of which
when so executed and delivered shall be an original, but all such counterparts
shall together constitute one and the same Amendment.


<PAGE>   6


                                     - 6 -



                  2. This Amendment shall be governed by and construed under
the internal laws of the State of New York, as the same may from time to time
be in effect, without regard to principles of conflicts of laws.

                  IN WITNESS WHEREOF, this Amendment has been duly executed as
of this 6th day of October, 1997.
                                           AMERICAN PRECISION INDUSTRIES INC.


                                           By ______________________________
                                                                      (Title)


                                           MARINE MIDLAND BANK


                                           By _____________________________
                                                    Cary J. Haller
                                                    Vice President




<PAGE>   7


                                     - 7 -

STATE OF NEW YORK    )
                     )  SS.:
COUNTY OF ERIE       )

          On this 6th day of October, 1997, , before me personally came , to me
known, who, being by me duly sworn, did depose and say that (s)he resides at
____________________________________________________________________________ ,
that (s)he is of AMERICAN PRECISION INDUSTRIES INC., the corporation described
in and which executed the foregoing instrument; and that (s)he signed h___ name
thereto by order of the Board of Directors of said corporation.


                                       ______________________________________
                                                   Notary Public




STATE OF NEW YORK    )
                     )  SS.:
COUNTY OF ERIE       )

          On this 6th day of October, 1997, before me personally came Cary J.
Haller, to me known, who, being by me duly sworn, did depose and say that he
resides at 1145 Youngs Road, Williamsville, New York; that he is a Vice
President of MARINE MIDLAND BANK, a bank organized under the laws of the State
of New York described in and which executed the foregoing instrument; and that
he signed his name thereto by order of the Board of Directors of said bank.


                                       ______________________________________
                                                   Notary Public