AI API keys

Odoo’s AI application settings contain options to control which AI provider the app utilizes, manage API credentials, and define the default prompts. Odoo supports both Gemini and OpenAI (ChatGPT) as providers in the AI application.

Some AI features can be used without the AI app installed. However, to use custom API credentials or to alter the AI provider used for a specific agent, the app must be installed.

Belangrijk

While users can add their own API keys, it is not required. However, some organizations may prefer to use their own keys for greater control over permissions, version updates, or internal policy compliance.

Create API key for ChatGPT

To create an API key for ChatGPT, visit API Key Page. Click Login and enter the login information for the OpenAI account.

On the API Keys page, click Create new secret key.

The API keys page in OpenAI.

This opens the Create new secret key pop-up. Select the owner of the new key:

  • You: the new key is tied to the user account and can make requests against the selected project. If the user is removed from the organization or project, this key is disabled.

  • Service account: creates a new bot member, or service account, of the project. The key is attached to the bot member.

Next, enter a Name for this key. This is optional, but recommended. Then, select the Project from the drop-down menu. Finally, select the appropriate Permissions.

The popup where new api keys are created in OpenAI.

Notitie

Setting the Permissions to Restricted requires setting the read and write permissions to multiple resources individually. For more information, see OpenAI Platform Docs.

Click Create secret key. On the resulting pop-up, click Copy to copy the new key.

Waarschuwing

Once this pop-up closes, the key cannot be viewed again. If it is lost, a new key will need to be created.

The popup displaying the newly created OpenAI key.

Return to Odoo, and navigate to AI app ‣ Configuration ‣ Settings. Under Providers, tick the checkbox for Use your own ChatGPT account, and paste the new key in the Key field. Click Save when finished.

Create an API key for Google Gemini

To create an API key for Google Gemini, visit API Keys. Enter the login information for the Google account, and click Next to open Google AI Studio. In the top right corner, click Create API Key.

The Gemini api keys page.

On the Create a new key pop-up, enter a title in the Name your key field. Next, use the Choose an imported project drop-down to select a project, or import a new one. Click Create key.

On the API Keys page, find the appropriate key and click the copy icon.

The new Gemini key with the copy button highlighted.

Return to Odoo, and navigate to AI app ‣ Configuration ‣ Settings. Under Providers, tick the checkbox for Use your own Google Gemini account, and paste the new key in the Key field. Click Save when finished.

Pricing

Utilizing API keys for AI may require additional fees through the provider. The exact costs depend on the AI model used and the account type with each provider.

For additional information on ChatGPT pricing, visit OpenAI API Pricing.

For additional information on Google Gemini pricing, visit Gemini API Pricing.