AI for self-hosted instances
Learn about using AI with self-hosted instances.
Self-hosted customers can deploy and embed Retool AI for use with apps and workflows. To learn more about how you can use Retool AI, refer to the Retool AI resource queries documentation.
Retool-managed and self-managed keys
LLM interactions work by making API requests with an AI provider. As with most other APIs, these requests require authorization credentials, such as an API key.
Retool provides access to Anthropic and OpenAI models using Retool-managed keys, which enable you to build without needing any additional tools or services. Usage is billed using AI credits. Using a Retool-managed key on a self-hosted instance requires additional configuration.
Enterprise organizations can bring their own key (BYOK) for any AI provider. Retool does not charge for BYOK usage, and all billing is done through your own agreements with the AI provider.
Retool-managed key configuration
To use AI features on self-hosted deployments with a Retool-managed key, set the following environment variables. Retool authorizes requests with your self-hosted Retool license key, so you don't need to request a separate token from Retool.
| Environment variable | Value |
|---|---|
LICENSE_KEY | Your self-hosted Retool license key. |
OPENAI_PROXY_HOST | Set to https://ai-proxy.retool.com. |
OPENAI_SECRET_KEY | Set to an empty string. |
OPENAI_PROXY_API_TOKEN is optional. If your instance already sets it, the instance continues to use that token.
While these environment variables include OPENAI in the name, you can use them for any available provider.
Alternatively, bring your own key and set it from the Settings > AI resource page.
To turn off Retool-managed keys on your instance, set DISABLE_RETOOL_MANAGED_AI to true. Requests that use a Retool-managed key then fail until you unset the variable or users configure their own AI provider.
Retool-managed Vectors
Retool-managed Vectors for self-hosted instances are built on Retool Database. To store vector data, you must configure and enable Retool-managed Vectors and Retool Database.
Data sharing and retention
When Retool AI is used to build or configure a query, application, or workflow (e.g., prompting Ask AI to help write queries), the input is shared with the applicable third-party LLM provider, listed in our Subprocessors page. Inputs are deleted within 30 days.
Any inputs or outputs that correspond to the categories above may continue to be used to inform product improvements. Retool does not use any inputs submitted to, or outputs generated from, Retool AI that is embedded within a deployed application or workflow (e.g., text stored in Retool-managed Vectors). These inputs and outputs are treated as "Customer Data" in accordance with the Customer Terms of Service, Security Practices, and Data Processing Addendum.
Learn more about data and security in the app builder.
Additional resources
Refer to the following documentation for ways you can use AI within Retool: