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
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:
OpenAI Platform for GPT models, fine-tuned models, and OpenAI Assistants
Anthropic Console for Claude models
DeepSeek Platform for DeepSeek models
Google AI Studio for Gemini models
Mistral AI for Mistral models
OpenRouter for access to various models from different AI providers using a single API key
Perplexity for Perplexity models
xAI Cloud Console for xAI models
Set personal API keys
If you want to share an API key with your space members, set it as a space key.
- Excel
- Sheets
- Word
- Docs
Open a Microsoft Excel workbook.
In the Home tab, click GPT for Excel Word.
infoYou can also select Home > Add-ins > My Add-ins > GPT for Excel Word.
In the sidebar menu, select API keys & endpoints.
In the Your API keys tab, enter your API key in the appropriate field and click Save.
noteIf 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.
You must be the Creator, Editor, or Owner of the spreadsheet to set the API key.
Open a Google spreadsheet.
In the menu bar, select Extensions > GPT for Sheets and Docs > Open.
In the sidebar menu, select API keys.
Enter your API key in the appropriate field and click Save.
noteIf 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 Sheets.
Open a Microsoft Word document.
In the Home tab, click GPT for Excel Word.
infoYou can also select Home > Add-ins > My Add-ins > GPT for Excel Word.
In the sidebar menu, select Manage API keys.
In the Your API keys tab, enter your API key in the appropriate field and click Save.
noteIf 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 Word.
You must be the Creator, Editor, or Owner of the document to set the API key.
Open a Google document.
In the menu bar, select Extensions > GPT for Sheets and Docs > Set API keys.
Enter your API key in the appropriate field and click Save key.
noteIf the AI provider already has a space API key set, you can override the key with your personal API key by entering your key and clicking Save key.
You have set the API key. You can now use any model available with the key in GPT for Docs.
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.
- Excel
- Sheets
- Word
- Docs
In the sidebar menu, select API keys & endpoints.
Check the text in the AI provider's API key field:
Field text What it means Example 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.
In the sidebar menu, select API keys.
Check the text in the AI provider's API key field:
Field text What it means Example 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.
In the sidebar menu, select Manage API keys.
Check the text in the AI provider's API key field:
Field text What it means Example 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.
Select Extensions > GPT for Sheets and Docs > Set API keys.
Check the note above the AI provider's API key field.
Note What it means Example Using <AI provider> API key from your space.
You're using the space API key for the AI provider.
An <AI provider> API key is set.
You're using a personal API key for the AI provider.
Switch to a space API key
Prerequisites
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.
- Excel
- Sheets
- Word
- Docs
In the sidebar menu, select API keys & endpoints.
Click Remove for the API key you want to delete.
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.
In the sidebar menu, select API keys.
Click Remove for the API key you want to delete.
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.
In the sidebar menu, select Manage API keys.
Click Remove for the API key you want to delete.
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.
Select Extensions > GPT for Sheets and Docs > Set API keys.
Click Clear key for the API key you want to delete.
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.
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.
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.

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:
Permission | Description |
---|---|
Models | List available models. |
Model capabilities | Use model capabilities, such as chat completion. |
Assistants | Connect OpenAI Assistants to Google Sheets or Microsoft Excel. |
Fine-tuning | Connect OpenAI fine-tuned models to Google Sheets or Microsoft Excel. |
Files | Use OpenAI Assistants with file search. |
What's next
Need to use your own LLM service endpoint for models?