Use models with your own API keys
You do not need your own API key to use GPT for Work extensions (except GPT for Docs), but using your own key offers several benefits:
- Models: Access a wider range of models.
- Control: Monitor and manage your AI usage and costs directly from the AI provider's console.
- Privacy: We do not log inputs and outputs when you use a model with your own API key. See our privacy policy.
- Costs: If you're on self-service pricing, using your own 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.
Create API keys
To create your own API key, go to the AI provider's platform and follow their instructions:
- OpenAI platform for GPT models, fine-tuned models, and OpenAI Assistants.
Note: Only use an API key from an OpenAI organization that is at least Tier 3. Access your organization settings to verify your current tier. - Anthropic console for Claude models.
- Google AI Studio for Gemini models.
Note: It may take a few hours for a Gemini API key to become fully activated after creation. - Mistral AI console for Mistral models.
Check your API key (OpenAI)
You can check that your OpenAI API key is working with our API key tester.
Open the API key tester.
Click Use template to create a copy of the template in your own Google Sheets.
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 your API key.
If your API key is not working, check in the OpenAI platform that its permissions aren't restricted. The following permissions are required:
Permission | Description |
---|---|
Models and Model capabilities | For all API keys |
Assistants | To connect OpenAI Assistants to Google Sheets / Microsoft Excel |
Fine-tuning | To connect OpenAI fine-tuned models to Google Sheets / Microsoft Excel |
Files | To use OpenAI Assistants with File search |
Set API keys in GPT for Work
- Excel
- Sheets
- Word
- Docs
- Open a Microsoft Excel workbook.
Click GPT for Excel Word in the Home tab. If you don't see it, go to Home > Add-ins > My add-ins > GPT for Excel Word.
Select API keys from the sidebar menu.
Enter your API key in the appropriate field and click Save. For OpenAI API keys, you can also enter your OpenAI organization ID. If you are part of multiple organizations, entering an organization ID ensures that you get billed on the correct account.
Open a Google spreadsheet.
Check your permissions on the current spreadsheet, depending on its location:
- My Drive: You must be the Owner of the spreadsheet. You can find out who the Owner of a file is by checking the file Details.
- Shared Drive: You must be the Creator of the spreadsheet. You can find out who the Creator of a file is by checking the file Activity.
If your permissions differ from these, create a Google spreadsheet or ask someone with the appropriate permissions to set up the API key for you.
Select Extensions > GPT for Sheets and Docs > Open.
Select API keys from the sidebar menu.
Enter your API key in the appropriate field and click Save. For OpenAI API keys, you can also enter your OpenAI organization ID. If you are part of multiple organizations, entering an organization ID ensures that you get billed on the correct account.
Use GPT for Sheets bulk tools or GPT functions.
- Open a Microsoft Word document.
Click GPT for Excel Word in the Home tab. If you don't see it, go to Home > Add-ins > My add-ins > GPT for Excel Word.
Select API keys from the sidebar menu.
Enter your API key in the appropriate field and click Save. For OpenAI API keys, you can also enter your OpenAI organization ID. If you are part of multiple organizations, entering an organization ID ensures that you get billed on the correct account.
- Open a Google document.
Select Extensions > GPT for Sheets and Docs > Set API keys.
Enter your API key in the appropriate field and click Save key.
Edit and create text with GPT for Docs.
Learn more
For more information about selecting a model, see: