Skip to main content

Set and manage API keys

Using API keys offers several benefits:

  • More models. Access a wider range of models from a bigger pool of AI providers than what is available without API keys.

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

  • Improved privacy. We do not log inputs and outputs when you use a model with an API key. For more information, see our security and privacy FAQ.

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

If you're on a subscription plan, using an API key is mandatory since you do not have access to models without a key.

Personal vs. space API keys

You have two types of API keys in GPT for Work:

  • Personal API keys are your own private keys that work only for you. Only you have access to models associated with the keys, and only you can set and manage the keys.

  • Space API keys are shared keys that work for all members of a space. Members automatically have access to models associated with the keys, but only the space owner can set and manage the keys. For example, only you can set and manage space keys for your space. Billing for a space key reflects its usage by all members.

If you have both a personal key and a space key set for the same AI provider, the personal key overrides the space key.

You can use the same API key from an AI provider either as a personal key or as a space key.

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 an API key, go to the AI provider's platform and follow their instructions:

Set personal API keys

tip

If you want to share an API key with your space members, set it as a space key.

  1. Open a Microsoft Excel workbook.

  2. In the Home tab, click GPT for Excel Word.

    GPT for Excel Word in the Home ribbon

    info

    You can also select Home > Add-ins > My Add-ins > GPT for Excel Word.

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

  4. In the Your API keys tab, enter your API key in the appropriate field and click Save.

    note

    If the AI provider already has a space API key set, you can override the key with your personal API key by clicking Set your own and entering and saving your key.

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

Manage API keys

Check whether you're using a personal or space API key

You can check whether you're using a personal API key or a space API key for a specific AI provider.

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

  2. Check the text in the AI provider's API key field:

    Field textWhat it meansExample

    Using space key

    You're using the space API key for the AI provider.

    xxxxx...

    You're using a personal API key for the AI provider.

Switch to a space API key

Prerequisites
The space owner has set the space API key.

If you're currently using a personal API key for an AI provider but want to switch to using the space API key for the same provider, delete the personal key from GPT for Work.

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

  2. Click Remove for the API key you want to delete.

  3. Click Remove API key to verify.

    The API key defaults to the space API key.

You're now using the space API key for the AI provider.

Switch to a personal API key

If you're currently using the space API key for an AI provider but want to switch to using a personal API key for the same provider, simply set the personal key in GPT for Work. A personal key always overrides a space key.

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