# OpenAI

### **Configuring PowerPilot (AI) in Power Embedded**

To have an assistant in the portal, you need to configure the following steps:

1. Validate the [prerequisites ](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/pre-requisitos.md)in the Power BI Admin Portal (you are here).
2. Contract the model on [Azure OpenAI](/en/administration-portal/power-pilot-ai/hiring-an-ai/azure-openai.md) or [OpenAI (ChatGPT)](/en/administration-portal/power-pilot-ai/hiring-an-ai/openai.md)
3. [Create a model ](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/assistentes-de-ia.md)on Power Embedded
4. [Create an assistant](https://github.com/dirceuresende/docs-power-embedded-english/blob/main/administration-portal/power-pilot-ai/assistentes-de-ia.md) on Power Embedded

Requirements for Creating an Assistant on the OpenAI Portal

* Have an account registered with OpenAI.
* Have a payment method configured for billing. (It is necessary to have a payment method registered for the assistant to work)

To create the AI access feature, [click on this link.](https://platform.openai.com/assistants)

**Step 1** – The first step to create an assistant through OpenAI is to create a "Secret Key". To do this, go to **API Keys > Create new secret key.**

<figure><img src="/files/E51QTSwKkfxBmk2h54hy" alt=""><figcaption></figcaption></figure>

After clicking on **API Keys or API Key**, you will see a button to validate your phone number if your account is newly created. After validation, you can create your first **API key**.

\
The "Owned By" field can be left as default; define a name for your key and click on "Create secret key"

<div align="left"><figure><img src="/files/lanuAoq1NQrW2RM3bVu7" alt=""><figcaption></figcaption></figure></div>

Make sure to copy and store your API key in a secure location. See the example below:

<div align="left"><figure><img src="/files/yLQnnzSarlMWw5ITVDkE" alt=""><figcaption></figcaption></figure></div>

Copy this key and save it in a notepad. This key is what you will paste in the "Key" field when creating the AI model in the admin portal. It is very important to save this key, as it cannot be recovered once you leave this screen.

**Step 2 –** Defining the Model for Your AI Assistant

<figure><img src="/files/cGw5JqRpMQzYGG0yFsny" alt=""><figcaption></figcaption></figure>

When you click on "Create", you are redirected to the model creation tab.

Fill in the name fields and define which AI model will be used. For this documentation, we are using the "gpt-4o-mini" model, which currently has a lower cost per token. Once you fill in the fields, just create the assistant.

<figure><img src="/files/ZlimrSWcmvWp2kOuqVMP" alt=""><figcaption></figcaption></figure>

Done, now we need to go to the Power Embedded portal to create a model and create an assistant.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.powerembedded.com.br/en/administration-portal/power-pilot-ai/hiring-an-ai/openai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
