# AI API

**Application**\
The AI Call feature is used to obtain a result through an API call to OpenAI. This result can then be used as a variable within a workflow or sent directly to the customer.

* By clicking on the "AI API" component, you will add a white block to your whiteboard
* This block has 2 purple dots. You can connect with any blocks you want.&#x20;
* If you need to use them, don't hesitate to contact our team for more detailed guidance.

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

* There will be an edit block appearing once you click on the block

<figure><img src="/files/1A4bGRESt9fVP0f7EtyU" alt="" width="375"><figcaption></figcaption></figure>

* **OpenAI Key**: The OpenAI API key is provided by the customer to authenticate requests.
* **Select Model**: Choose the specific OpenAI model to be used for the API call.
* **Prompt**: The input text (or prompt) that will be sent to OpenAI during the API call.
* **Select Action with the Result after Calling from API**: Choose what to do with the result returned from the API call:
  * **Save as Variable**: Store the result as a variable to be used later in other workflow blocks that utilize variables.

<mark style="color:red;">**= Please remember to click the "Save changes" button before leaving.**</mark>


---

# 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://documents.cxgenie.ai/bots/workflow/workflow-components-1/ai-api.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.
