Set and manage API keys
Using API keys offers several benefits:
-
More models. Access to a wider range of models from a bigger pool of AI providers than what is available without API keys.
-
More control. Monitor and manage 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.
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 API keys
You set API keys for your space in the GPT for Work dashboard. You set the keys per platform, so the keys you set for a Google account space apply to both GPT for Sheets and GPT for Docs, while the keys your set for a Microsoft account space apply to both GPT for Excel and GPT for Word.
The API keys you set work for all users in your space. Users automatically have access to models associated with the keys, but only the space owner (you) and admins can set and manage the keys. Billing for a key reflects its usage by all users.
Google
Microsoft
-
Create an API key or request an API key from your AI provider platform admin. Learn more.
-
Sign in to the GPT for Work dashboard with your Google account.
-
In the sidebar, select API keys.
-
In the AI providers list, click the provider whose API key you want to set.

-
Set the API key:
-
In the text field, enter the key.
-
Click Check to verify that the key is valid.
-
Click Save.

-
You have set the API key. You can now use any model available with the key in GPT for Sheets and GPT for Docs.
-
Create an API key or request an API key from your AI provider platform admin. Learn more.
-
Sign in to the GPT for Work dashboard with your Microsoft account.
-
In the sidebar, select API keys.
-
In the AI providers list, click the provider whose API key you want to set.

-
Set the API key:
-
In the text field, enter the key.
-
Click Check to verify that the key is valid.
-
Click Save.

-
You have set the API key. You can now use any model available with the key in GPT for Excel and GPT for Word.
Check API keys
You can verify whether the API keys you have set are valid.
Check all API keys at once
Google
Microsoft
-
Sign in to the GPT for Work dashboard with your Google account.
-
In the sidebar, select API keys.
-
Click Check all API keys.

The page displays a warning for each key that is invalid.

If a key is invalid, create a new key and replace the invalid value with the new one.
-
Sign in to the GPT for Work dashboard with your Microsoft account.
-
In the sidebar, select API keys.
-
Click Check all API keys.

The page displays a warning for each key that is invalid.

If a key is invalid, create a new key and replace the invalid value with the new one.
Check a specific API key
Google
Microsoft
-
Sign in to the GPT for Work dashboard with your Google account.
-
In the sidebar, select API keys.
-
Click the edit icon for the key you want to check.

-
Click Check.

The UI displays a message indicating whether the key is valid or invalid.


If the key is invalid, create a new key and replace the invalid value with the new one.
-
Sign in to the GPT for Work dashboard with your Microsoft account.
-
In the sidebar, select API keys.
-
Click the edit icon for the key you want to check.

-
Click Check.

The UI displays a message indicating whether the key is valid or invalid.


If the key is invalid, create a new key and replace the invalid value with the new one.
Troubleshoot OpenAI API keys
You can use our API key checker to check which models are available through your OpenAI key.
-
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 are not restricted. The following permissions are required:
| Permission | Description |
|---|---|
| List models | List all 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? Connect to an OpenAI-compatible endpoint.