Skip to main content

Connect to OpenAI Assistants from Sheets and Excel

GPT for Sheets and GPT for Excel can connect to OpenAI Assistants, which provide a powerful way to customize OpenAI models for specific tasks.

To use an OpenAI Assistant:

  1. Create the Assistant.

  2. Set an OpenAI API key for your space.

  3. Select the Assistant in GPT for Sheets or GPT for Excel.

Create an OpenAI Assistant

The following steps show how to create an Assistant from scratch. If you already have an Assistant, you can skip to Use an OpenAI Assistant in GPT for Work.

  1. Log in to the OpenAI Platform.

  2. Open the Assistants settings and click Create.

  3. Configure the Assistant:

    • Name: Give your Assistant a name that describes its purpose.

    • System instructions: Provide detailed instructions for the Assistant's behavior and capabilities.

    • Model: Choose an appropriate model, for example gpt-4o. Learn more.

    Configure the Assistant
  4. If you want your Assistant to use specific files for reference, use the File search feature to attach them:

    1. Enable File search and click Files.

      Upload files
    2. In the file attachment screen, select the files and click Attach.

      Attach files

You have created the Assistant. You can now use the Assistant in GPT for Sheets and GPT for Excel.

Set an OpenAI API key for your space

  1. Create an API key or request an API key from your AI provider platform admin. Learn more.

  2. Sign in to the GPT for Work dashboard with your Google account.

  3. In the sidebar, select API keys.

  4. In the AI providers list, click the provider whose API key you want to set.

    Select the AI provider
  5. Set the API key:

    1. In the text field, enter the key.

    2. Click Check to verify that the key is valid.

    3. Click Save.

    Set the API key

Select the OpenAI Assistant

  1. Open a Google spreadsheet.

  2. In the menu bar, select Extensions > GPT for Sheets and Docs > Open.

    Launch GPT for Sheets
  3. In the sidebar menu, select Bulk AI tools or GPT functions.

  4. Expand the model switcher. You can find the Assistant under Use your API key or endpoint.

    Select a model
  5. Select the Assistant.

GPT for Sheets now uses the Assistant to generate responses for bulk AI tools and GPT functions.

What's next