Skip to main content

Set up your OpenAI API key

Set up your own OpenAI API key to benefit from cost savings, your own rate limits, and the use of your fine-tuned models. You can follow the steps in this article to set up your key from Google Sheets, or you can set it up from Google Docs.

Prerequisites
  1. Create a Google spreadsheet.

  2. Click Extensions > GPT for Sheets and Docs > Set API key.

    The sidebar appears on the right of your Google spreadsheet.

    warning

    If you get an error, it means you are likely using multiple Google accounts in the same Chrome session. To fix this, create a dedicated Chrome profile, then create a new spreadsheet and set up your OpenAI key in this new spreadsheet.

    If the problem persists, please let us know by submitting a support request so we can assist you further.

  3. Paste your secret key where indicated, then click Next.

  4. (Highly recommended) Test your key by typing a simple formula in a cell and get a response from GPT:

    =GPT("Say hi")
  5. Click Next to get more info on OpenAI costs and how to control them.

  6. Click I understand.

You have set up your OpenAI API key in GPT for Sheets and Docs.

You can also set up an Anthropic API key and use Claude models in GPT for Sheets.