Skip to main content

Use models with your own API keys

Using your own API keys is mandatory if you're on a subscription plan. Keys also offer several benefits:

  • More models. Access a wider range of models.

  • More control. Monitor and manage your AI usage and costs directly from the AI provider's console.

  • Improved privacy. We do not log inputs and outputs when you use a model with your own key. See our privacy policy.

  • Reduced costs. If you're on pay-per-use pricing, using your own key reduces costs. You pay the model usage fees directly to the AI provider, while paying a reduced service fee for GPT for Work.

Create API keys

info

Make sure your keys belong to an organization or project with the following rate limits:

  • RPM (requests per minute) ≥ 1,000

  • TPM (tokens per minute) ≥ 1,000,000

The actual limits required depend on your workload requirements.

To create your own API key, go to the AI provider's platform and follow their instructions:

Set API keys in GPT for Work

You can set your own API keys either in the GPT for Work dashboard or directly in the add-ons.

tip

If you want to share your key with the members of your space, set the key as a space key.

  1. Open a Microsoft Excel workbook.

  2. Click GPT for Excel Word in the Home tab.

    Home Ribbon

    info

    You can also go to Home > Add-ins > My add-ins > GPT for Excel Word.

  3. In the sidebar menu, select API keys & endpoints.

  4. Enter your API key in the appropriate field and click Save.

You have set the API key. You can now use any model available with the key in GPT for Excel.

Select a model with an API key

  1. Expand the model switcher.

  2. Select a model with a key icon.

    Models that are available with your API keys are listed under Use your API key or endpoint and have a key icon in front of their name.

GPT for Excel uses the selected model to generate all responses.

Troubleshoot OpenAI API keys

You can use our API key checker to verify that your OpenAI API key is working.

  1. Open the OpenAI API key checker and click Use template.

    Google Sheets creates a copy of the spreadsheet in your Google drive and opens the spreadsheet for editing.

  2. Enter your OpenAI API key in cell B12.

The results show the status of your OpenAI API key and the models and Assistants available through the key.

API key tester

If your API key is not working, check on the OpenAI Platform that the key's permissions aren't restricted. The following permissions are required:

PermissionDescription
ModelsList available models.
Model capabilitiesUse model capabilities, such as chat completion.
AssistantsConnect OpenAI Assistants to Google Sheets or Microsoft Excel.
Fine-tuningConnect OpenAI fine-tuned models to Google Sheets or Microsoft Excel.
FilesUse OpenAI Assistants with file search.

What's next

Learn more about models:

Put your selected model to use:

  • Use bulk AI tools to run prompts on entire spreadsheet columns at once without writing any formulas.

  • Use GPT functions to run prompts from inside spreadsheet cells.