EXHIBIT 10.38

                    AMENDED AND RESTATED HAZARDOUS MATERIALS
                            UNDERTAKING AND INDEMNITY

      This Amended and Restated Hazardous Materials Undertaking and Indemnity
(this "Indemnity") is executed by CALPINE CORPORATION, a Delaware corporation
(the "Indemnitor") in favor of THE BANK OF NEW YORK, a New York banking
corporation ("BONY"), not in its individual capacity but solely as Collateral
Trustee under the Collateral Trust Agreement dated July 16, 2003 (the
"Collateral Trust Agreement") among Indemnitor, BONY, the 2007 Trustee, the 2010
Trustee, the 2013 Trustee, Credit Agreement Agent and Term Loan Administrative
Agent (collectively, with the Secured Debtholders and their successors and
assigns, the "Indemnified Parties"), whose address is 101 Barclay Street, New
York, New York 10286.

      Capitalized terms not otherwise defined herein shall have the meanings
ascribed thereto in the Collateral Trust Agreement.

                                    Recitals

      Indemnitor is party to that certain (i) Credit Agreement, dated as of
March 8, 2002 (herein, as the same may be amended, modified or supplemented from
time to time, called the "Existing 2002 Credit Agreement"), and (ii) Second
Amended and Restated Credit Agreement dated as of May 23, 2000 (herein, as the
same may be amended, modified, or supplemented from time to time, called the
"Existing 2000 Credit Agreement" and together with the Existing 2002 Credit
Agreement, collectively, the "Existing Credit Agreements").

      Indemnitor, as a condition to the making of the loans pursuant to the
Existing Credit Agreement has heretofore executed and delivered to The Bank of
Nova Scotia, for itself and as agent for the Lender Parties, that certain
Hazardous Materials Undertaking and Indemnity, dated as of May 1, 2002 (the
"Existing Hazardous Materials Indemnity").

      Indemnitor, the Existing Lenders and the Credit Agreement Agent have now
agreed to, among other things, (i) terminate the commitments under the Existing
2000 Credit Agreement, and (ii) amend and restate the Existing 2002 Credit
Agreement (as so amended and restated, and as the same may, from time to time
hereafter, be amended, supplemented, modified or amended and restated, the
"Amended and Restated Credit Agreement").

      Indemnitor also intends to issue the 2007 Notes, the 2010 Notes, and the
2013 Notes (collectively, the "Notes") and to borrow the Term Loans pursuant to
the Term Loan Agreement. The proceeds from the issuance of the Notes, and the
borrowing of the Term Loans will be used to refinance a portion of the loans and
other indebtedness outstanding under the Existing Credit Agreements.

      The Secured Debt is secured by, among other things, all of the right,
title and interest of Indemnitor in the real property and interests comprising
the oil and gas



reserves, gas, assets, power plants and any other real property at any time
owned by Indemnitor and now or hereafter mortgaged to BONY and all fixtures,
personal property and other improvements now existing or to be constructed on
any of such properties (such properties, descriptions of which are attached
hereto as Exhibit A, herein collectively called, the "Properties"), with respect
to which Indemnitor has executed counterparts of those certain mortgages or
deeds of trust dated July 16, 2003 (the "Mortgages").

      The Secured Debtholders have agreed to enter into the Secured Debt
Documents only if the Indemnified Parties are indemnified and held harmless with
respect to any risk that the Properties may now or in the future be in any way
contaminated, or its use or value impacted by any Hazardous Materials, as
defined below.

      It is a condition precedent to issuing the Secured Debt that Indemnitor
execute and deliver this Indemnity, which Indemnity amends and restates the
Existing Hazardous Materials Indemnity.

      In order to induce the Lenders to issue the Secured Debt, and with the
full intention and understanding that the Indemnified Parties will rely hereon,
Indemnitor represents, warrants, covenants and agrees as follows:

      1. CERTAIN DEFINITIONS. As used in this Indemnity, the following terms
shall have the following respective meanings:

      "Hazardous Materials" means crude or refined oil or fraction thereof,
petroleum substances, petrochemical products, PCBs, asbestos, asbestos
containing materials, urea formaldehyde, salts, flammable explosives,
radioactive materials, hazardous wastes, toxic, mutagenic or pathogenic
substances or related materials, including, without limitation, any substances
defined as or included in the definition of "hazardous substances," "hazardous
wastes," "hazardous materials," or "toxic substances" under any applicable
federal or state laws or regulations.

      "Hazardous Materials Laws" means all federal, state or local laws,
ordinances, regulations, orders and directives pertaining to Hazardous
Materials.

      2. REPRESENTATIONS AND WARRANTIES. Without limiting the generality of any
of the representations or warranties contained in the other Secured Debt
Documents, Indemnitor hereby represents and warrants to BONY and the other
Indemnified Parties that, except as disclosed on Exhibit B hereto, as of the
date of this Indemnity and continuing thereafter,

            (a) the Properties and each portion thereof (including the
      underlying groundwater) are not and have not been a site for the use,
      generation, manufacture, discharge, assembly, processing, storage,
      release, disposal or transportation to or from of any Hazardous Materials,
      except in connection with the production, storage and transportation of
      crude oil, natural gas, other


                                      -2-


      hydrocarbons and petroleum, and other petroleum products in the ordinary
      course of Indemnitor's business;

            (b) the Properties and each portion thereof (including the
      underlying groundwater) are presently in compliance in all material
      respects with all Hazardous Materials Laws, including, without limitation,
      those relating to exposure to Hazardous Materials, the labeling, storage
      and containment of Hazardous Materials, and air, soil and surface and
      ground water conditions;

            (c) there have been no past, and there are no pending or, to
      Indemnitor's knowledge, threatened

                  (i) claims, complaints, notices or requests for information
            received by Indemnitor with respect to any alleged violation of any
            Environmental Law, including Hazardous Materials Laws, that, singly
            or in the aggregate, may reasonably be expected to result in a
            Material Adverse Effect, or

                  (ii) complaints, notices or inquiries to Indemnitor regarding
            potential liability under any Environmental Law, including Hazardous
            Materials Laws, that, singly or in the aggregate, may reasonably be
            expected to result in a Material Adverse Effect;

            (d) there have been no unremediated Releases of Hazardous Materials
      at, on or under any property (including the Properties) now or previously
      owned or leased by Indemnitor that, singly or in the aggregate, result in,
      or may reasonably be expected to result in, a Material Adverse Effect;

            (e) Indemnitor has been issued and is in material compliance with
      all permits, certificates, approvals, licenses and other governmental
      authorizations relating to environmental matters and necessary for its
      businesses;

            (f) no property (including the Properties) now or previously owned
      or leased by Indemnitor is listed or proposed for listing (with respect to
      owned property only) on the National Priorities List pursuant to CERCLA,
      on the CERCLIS or on any similar state list of sites requiring
      investigation or clean-up;

            (g) Indemnitor has not directly transported or directly arranged for
      the transportation of any Hazardous Material to any location which is
      listed or proposed for listing on the National Priorities List pursuant to
      CERCLA, on the CERCLIS or on any similar state list or which is the
      subject of federal, state or local enforcement actions or other
      investigations which may lead to material claims against Indemnitor for
      any remedial work, damage to natural resources or personal injury,
      including claims under CERCLA;

            (h) there are no polychlorinated biphenyls or friable asbestos
      present at any property (including the Properties) now or previously owned
      or leased by


                                      -3-


      Indemnitor that, singly or in the aggregate, result in, or may reasonably
      be expected to result in, a Material Adverse Effect; and

            (i) no conditions exist at, on or under any property (including the
      Properties) now or previously owned or leased by Indemnitor which, with
      the passage of time, or the giving of notice or both, would give rise to
      liability under any Environmental Law, which liability would reasonably be
      expected to result in a Material Adverse Effect.

      3. COVENANTS. Indemnitor hereby covenants and agrees that, so long as any
obligation under any of the Secured Debt Documents or otherwise in connection
with the Secured Debt is outstanding:

            (a) Indemnitor shall not permit the Properties or any portion of any
      parcel thereof to be a site for the use, generation, manufacture,
      discharge, assembly, processing, storage, Release, disposal or
      transportation to or from of Hazardous Materials except (i) as disclosed
      on Exhibit B hereto, (ii) in such quantities and as may be necessary for
      the production, storage and transportation of crude oil, natural gas and
      other Hydrocarbons (as defined in the Mortgages) in the ordinary course of
      Indemnitor's business as conducted on the Effective Date, (iii) as
      necessary or required to develop the Properties in the ordinary course of
      Indemnitor's business and (iv) as may be necessary to respond to any
      emergency, each of which excepted activities will be conducted in a manner
      designed to minimize environmental risk;

            (b) Indemnitor shall keep and maintain the Properties and each
      portion of any parcel thereof in compliance in all material respects with
      all Environmental Laws, including Hazardous Materials Laws (and to the
      extent there are violations of such laws existing as of the date hereof
      which are disclosed on Exhibit B, with the remediation plans and work
      plans listed on Exhibit B), and otherwise shall not cause or permit the
      Properties or any portion of any parcel thereof to be in violation, in any
      material respect, of such laws;

            (c) As to any claim or matter not disclosed on Exhibit B, Indemnitor
      shall immediately advise BONY and each of the Secured Debt Representatives
      in writing of:

                  (i) any and all enforcement, cleanup, removal or other
            governmental or regulatory actions instituted, completed or
            threatened against Indemnitor or the Properties pursuant to any
            applicable Environmental Laws, including Hazardous Materials Laws
            that, singly or in the aggregate, have, or may reasonably be
            expected to have, a Material Adverse Effect;

                  (ii) any and all material claims made or threatened by any
            third party against Indemnitor or the Properties relating to any
            claim, liability, cause of action, nuisance, fine, penalty, charge,
            administrative or judicial


                                      -4-


            order or proceeding, judgment, remedial action or cleanup
            requirement, enforcement, damage, contribution, cost recovery,
            compensation, loss or injury resulting from any Hazardous Materials
            that, singly or in the aggregate, have, or may reasonably be
            expected to have, a Material Adverse Effect (the matters set forth
            in Sections 3(c)(i) and (ii) hereof are hereinafter referred to as
            "Hazardous Materials Claims");

                  (iii) any change in any claim or matter disclosed in Exhibit B
            that, singly or in the aggregate, have, or may reasonably be
            expected to have, a Material Adverse Effect; and

                  (iv) For the purpose of protecting the collateral given to
            secure the Obligations, BONY and any Secured Debt Representative
            shall have the right to join and participate in, as a party if it so
            elects, any legal proceedings or actions initiated in connection
            with any Hazardous Materials Claims and to have its reasonable
            attorneys' fees and expenses in connection therewith paid by
            Indemnitor;

            (d) Indemnitor shall not, without the prior written consent (which
      consent shall not be unreasonably withheld or delayed) of a Secured Debt
      Representative, take any remedial action in response to the presence of
      any Hazardous Materials on, under, or about the Properties (except (i)
      with respect to oil, gas and other Hydrocarbons, in the ordinary course of
      Indemnitor's business, or (ii) as may be necessary to respond to any
      emergency), nor enter into any settlement agreement, consent decree, or
      other compromise in respect of any Hazardous Material Claim in excess of
      $250,000;

            (e) Annually, at the time Indemnitor's audited financial statements
      are required to be delivered pursuant to any Secured Debt Document,
      Indemnitor shall deliver to BONY and each Secured Debt Representative a
      report discussing significant issues or concerns arising, or measures
      taken, during the preceding year and those contemplated for the following
      year relating to compliance with Hazardous Materials Laws and
      Environmental Laws, including, without limitation, compliance with any
      then effective order of the Regional Water Quality Control Board (or other
      lead agency) pertaining to the characterization, abatement and remediation
      of soil and groundwater contamination of the Properties;

            (f) To the extent that Indemnitor has the right to do so, Indemnitor
      shall permit BONY and any Secured Debt Representative or its agents, at
      the cost and expense of Indemnitor, to enter upon the Properties and all
      parts thereof, for the purpose of investigating and inspecting the
      condition and operation thereof, and shall permit reasonable access to the
      field offices and other offices, including the principal place of
      business, of Indemnitor to inspect and examine the Properties and to
      inspect, review and reproduce as necessary any books, records, accounts,
      contracts or other documents of Indemnitor;


                                      -5-


            (g) Without limiting the generality of the foregoing clause (f),
      BONY and any Secured Debt Representative shall have the right, subject to
      any existing contractual restrictions binding on Indemnitor and on
      twenty-four (24) hours prior notice to Indemnitor, to cause such persons
      and entities as such parties may designate to enter the Properties to
      conduct (at the cost and expense of Indemnitor), or to cause Indemnitor to
      conduct (at the cost and expense of Indemnitor), such tests and
      investigations as such parties deem necessary to determine whether any
      hazardous substance or solid waste is being generated, transported,
      stored, or disposed of in accordance with applicable Environmental Laws.
      Such tests and investigations may include, without limitation, underground
      borings, ground water analyses and borings from the floors, ceilings and
      walls of any improvements located on the Properties. This Section 3(g)
      shall not be construed to affect or limit the obligations of Indemnitor
      pursuant to Section 4 hereof;

            (h) Neither BONY nor any Secured Debt Representative shall have any
      duty to visit or observe the Properties or to conduct tests, and no site
      visit, observation or testing by such parties shall impose any liability
      on such parties, nor shall Indemnitor or any other Obligor be entitled to
      rely on any visit, observation or testing by BONY and/or any Secured Debt
      Representative in any respect. BONY and any Secured Debt Representative
      may, in its discretion, disclose to Indemnitor or any other Person,
      including any governmental agency, any report or finding made as a result
      of, or in connection with, any site visit, observation or testing by such
      parties. Indemnitor agrees that no warranty or representation is made by
      these parties to Indemnitor or any other Obligor regarding the truth,
      accuracy or completeness of any such report or findings that may be so
      disclosed. Indemnitor also acknowledges that, depending upon the results
      of any site visit, observation or testing by such parties and disclosed to
      Indemnitor, Indemnitor may have a legal obligation to notify one or more
      governmental agencies of such results, that such reporting requirements
      are site-specific, and are to be evaluated by Indemnitor without advice or
      assistance from such parties; and

            (i) Cooperate fully with any environmental consultant retained by
      BONY and/or any Secured Debt Representative to prepare reports on the
      Properties.

      4. CONTINUING INDEMNITY. Indemnitor hereby agrees to indemnify, hold
harmless and defend (by one law firm of counsel reasonably satisfactory to BONY
and/or any Secured Debt Representative unless an Event of Default shall have
occurred and be continuing) the Secured Debt Representatives and the Indemnified
Parties and their directors, officers, employees, agents, successors and assigns
(collectively, "Indemnitees") from and against any and all claims (including
without limitation third party claims for personal injury or real or personal
property damage), losses, damages, liabilities, fines, penalties, charges,
administrative and judicial proceedings (including informal proceedings) and
orders, judgments, remedial action requirements, enforcement actions of any
kind, and all costs and expenses incurred in


                                      -6-


connection therewith (including but not limited to reasonable attorneys' and/or
paralegals' fees and expenses), including, but not limited to, all costs
incurred in connection with any investigation or monitoring of site conditions
or any clean-up, remedial, removal or restoration work by any federal, state or
local government agency, arising directly or indirectly, in whole or in part,
out of (i) the presence on or under the Properties of any Hazardous Materials,
or any escape, seepage, leakage, spillage, discharge, emission or Release of any
Hazardous Materials on, under or from the Properties, or (ii) any activity
carried on or undertaken on or off the Properties, whether prior to or during
the term of the Secured Debt, and whether by Indemnitor or any predecessor in
title or any employees, agents, contractors or subcontractors of Indemnitor or
any predecessor in title, or any third persons at any time occupying or present
on the Properties, in connection with the handling, treatment, removal, storage,
decontamination, clean-up, transport or disposal of any Hazardous Materials that
at any time are located or present on or under or that at any time migrate,
flow, percolate, diffuse or in any way move onto or under the Properties;
provided however, that nothing herein shall require Indemnitor to indemnify
Indemnitees for any matter arising solely from the gross negligence or wilful
misconduct of BONY. The foregoing indemnity shall further apply to any residual
contamination on or under the Properties, or affecting any natural resources,
and to any contamination of any property or natural resources arising in
connection with the generation, use, handling, storage, transport or disposal of
any such Hazardous Materials, and irrespective of whether any of such activities
were or will be undertaken in accordance with applicable laws, regulations,
codes and ordinances. It is expressly understood and agreed that the indemnity
provided for herein shall survive: (i) the repayment of the Secured Debt and the
release of or reconveyance (whether full or partial) of the Mortgages; or (ii)
the acquisition of title to all or any portion of the Properties by BONY, or any
successor in interest to BONY, or any nominee or designee of any of them, by
foreclosure under or transfer in lieu of foreclosure of the Mortgages, whether
or not the same is otherwise in satisfaction of Indemnitor's obligations in
connection with the Secured Debt.

      5. TIME OF THE ESSENCE. Time is of the essence of this Indemnity.

      6. GOVERNING LAW. This Indemnity shall be governed by and construed in
accordance with the laws of the State of New York, except to the extent
preempted by Federal Law. Indemnitor irrevocably agrees that any legal action or
proceeding with respect to this Indemnity may be brought in a court of competent
jurisdiction of the State of New York or of the United States of America, as
BONY may elect, and by execution and delivery of this Indemnity the Indemnitor
hereby irrevocably submits to each such jurisdiction; and agrees that final
judgment against the Indemnitor in any such action or proceeding shall be
conclusive and may be enforced in any jurisdiction within the United States
including, without limitation, the State of New York, by suit on the judgment, a
certified copy of which shall be conclusive evidence of the fact and of the
amount of the indebtedness owed.

      7. INDEMNITOR WAIVERS. Indemnitor waives: (a) any defense based upon any
legal disability to enter into the Secured Debt Documents or other defense of
Indemnitor under the Secured Debt Documents; (b) any defense based on any lack
of


                                      -7-


authority of the officers, directors, partners or agents acting or purporting to
act on behalf of Indemnitor or any principal of Indemnitor, or any defect in the
formation of Indemnitor or any principal of Indemnitor; (c) any defense based
upon the application of the Secured Debt by Indemnitor for purposes other than
the purposes represented by Indemnitor to BONY or intended or understood by BONY
or Indemnitor; (d) any defense based upon BONY's election, in any proceeding
instituted under the Federal Bankruptcy Code, of the application of Section
111(b)(2) of the Federal Bankruptcy Code or any successor statute; (e) any
defense based upon any borrowing or any grant of security interest under Section
364 of the Federal Bankruptcy Code; (f) presentment, demand, protest and notice
of any kind; and (g) the benefit of any statute of limitations affecting the
liability of Indemnitor hereunder or the enforcement hereof.

      8. OTHER PROVISIONS.

            (a) This Indemnity is executed pursuant to the Secured Debt
      Documents and shall be construed, administered and applied in accordance
      with the terms and provisions thereof.

            (b) All notices pursuant to this Indemnity shall be delivered at the
      times, in the manner and to the addressees as set forth in any Secured
      Debt Documents.

            (c) No amendment to or waiver of any provision of this Indemnity nor
      consent to any departure by Indemnitor herefrom shall be effective unless
      the same shall be in writing and signed by BONY or a Secured Debt
      Representative and Indemnitor.

            (d) This Indemnity shall be binding on and for the benefit of, the
      parties hereto, together with their respective successors and assigns.

            (e) The obligations of Indemnitor hereunder shall survive any
      termination of this Indemnity and the termination of all the Secured Debt
      Obligations. The representations and warranties made by Indemnitor in this
      Agreement shall survive the execution and delivery of this Indemnity.

            (f) Any provision of this Indemnity which is prohibited or
      unenforceable in any jurisdiction shall, as to such provision and such
      jurisdiction, be ineffective to the extent of such prohibition or
      unenforceability without invalidating the remaining provisions of this
      Indemnity or affecting the validity or enforceability of such provision in
      any other jurisdiction.

            (g) The various headings of this Indemnity are inserted for
      convenience only and shall not affect the meaning or interpretation of
      this Indemnity or any provisions hereof.


                                      -8-


Dated: as of July 16, 2003

                                        "Indemnitor"

                                        CALPINE CORPORATION, a Delaware
                                        corporation


                                        By: /a/ B.A. Berligen
                                            ------------------------------------
                                            Name:  B.A. Berilgen
                                            Title: Executive Vice President



                                    EXHIBIT A
                                       to
                  HAZARDOUS MATERIAL UNDERTAKING AND INDEMNITY

                         Legal Description of Properties



                                    EXHIBIT B
                                       to
                  HAZARDOUS MATERIAL UNDERTAKING AND INDEMNITY

                            Description of Hazardous
                          Materials On Properties, etc.

                                      None.