Skip to main content

Connect to OpenAI Platform

Choose the right OpenAI connection

This integration connects to OpenAI's platform API for administrative operations, such as managing organization users and projects. Refer to the OpenAI integration guide instead if you want to use OpenAI's models to power AI apps, workflows, and agents.

The OpenAI Platform API lets OpenAI organization administrators manage their organization programmatically.

What you can do with the OpenAI Platform API in Retool

After you create an OpenAI Platform resource in Retool, you can:

  • Retrieve and manage organization users and their roles.
  • Retrieve and manage projects within your organization.
  • Query organization usage and billing data.
  • Automate organization administration tasks from other systems.

Before you begin

To connect the OpenAI Platform API to Retool, you need the following:

  • OpenAI organization: An OpenAI organization with administrator access.
  • Admin key: An admin key generated from your OpenAI account.
  • Retool permissions: Ability to create and manage resources in your organization.

Create an OpenAI Platform resource

Follow these steps to create an OpenAI Platform resource in Retool.

Create a new resource

In your Retool organization, navigate to Resources in the main navigation and click Create newResource. Search for OpenAI Platform and click the OpenAI Platform tile to begin configuration.

OpenAI Platform resource configuration form.

Configure general settings

Specify a name and description for the resource that indicates which OpenAI organization it connects to. The description provides more context to users and Assist about how to use the resource.

Example nameExample description
OpenAI Platform (Admin)Admin key used to manage organization users and projects.
OpenAI Platform (Usage reporting)Read-only connection used to build a usage and billing dashboard.

API version

Select the OpenAI Platform API version to use. Retool defaults to the most recent version, but you can select an earlier version if your integration depends on it.

Example
v2.3.0 (2024-08-08) (DEFAULT)

Configure authentication

OpenAI Platform authenticates using an admin key.

Admin key

Paste an admin key generated from the Admin keys page of your OpenAI account.

Example
sk-admin-1234567890abcdefghijklmnopqrstuvwxyz

Configure advanced options

Configure optional settings available under the Advanced options section of the resource configuration form.

Outbound region

If your organization uses outbound regions, select the region that should be used for requests to the OpenAI Platform API. This controls which geographic region your requests originate from.

Verify the connection

OpenAI Platform resources don't include a Test connection button. To confirm your resource is configured correctly, save the resource and run a simple query, such as listing organization users.

Save the resource

Click Create resource to save your OpenAI Platform resource. You can now use it in queries across your Retool apps and automations.

Interact with OpenAI Platform data

Once you've created an OpenAI Platform resource, you can interact with OpenAI Platform data using Retool.

Caution

The OpenAI Platform API isn't yet supported in the new app builder. Use a classic app, workflow, or agent instead.

For classic apps, workflows, and agents, refer to the REST API queries documentation to learn how to write a resource query.

Best practices

Follow these best practices to maintain the security of your OpenAI Platform resource.

  • Restrict admin key access: Admin keys grant broad access to your OpenAI organization. Limit who can view or edit the resource in Retool.
  • Rotate credentials regularly: Regenerate the admin key on a regular schedule, and immediately if a key is ever exposed.
  • Use resource environments: Organizations on an Enterprise plan can configure multiple resource environments to maintain separate OpenAI Platform credentials for production, staging, and development.