# Open AI

{% hint style="warning" %}
**Security Warning**

The current action shares the state with the OpenAI API, so it's not recommended for sensitive workspaces. Future versions will provide a mask method before sending the data.
{% endhint %}

### Description

The Ask Workspace action allows users to interact with OpenAI's GPT-4o model to ask questions and get assistance related to their Terraform Workspace. This action provides a chat interface where users can ask questions about their Workspace's Terraform state and receive helpful responses from the AI.

### Display Criteria

By default, this Action is disabled and when enabled will appear for all resources. If you want to display this action only for certain resources, please check [display criteria](#display-criteria).

### Setup

This action requires the following variables as [Workspace Variables](https://docs.terrakube.io/2.21.0/user-guide/variables#workspace-specific-variables) or [Global Variables](https://docs.terrakube.io/2.21.0/user-guide/organizations/global-variables) in the Workspace Organization:

* **OPENAI\_API\_KEY**: The API key to authenticate requests to the OpenAI API. Please check [this guide](https://platform.openai.com/docs/quickstart/step-2-set-up-your-api-key) in how to get an OPEN AI api key

### Usage

* Navigate to the `Workspace` and click on the `Ask Workspace` button.

<figure><img src="https://3421131615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx1Ja1Osjf4KfhcMlJJom%2Fuploads%2Fgit-blob-2839d9556ae71fa81212bfee9e55611b6486a041%2Fimage%20(5)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

* Enter your questions and click the **Send** button or press the **Enter** key.

<figure><img src="https://3421131615-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx1Ja1Osjf4KfhcMlJJom%2Fuploads%2Fgit-blob-9bf5f82b6bb96988651ef1f039ba611331336469%2Fimage%20(6)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>
