# AI

{% hint style="info" %}
Supported AI:

* OpenAI
* Gemini
* Claude
  {% endhint %}

The **AI Adapter** provides a flexible interface for integrating AI models into the application, supporting **OpenAI, Gemini** and **Claude**.

#### How It Works:

1. **Set up API key:** Ensure `AI_API_KEY` is configured in the `.env` variables.
2. **Choose AI provider:** Define whether OpenAI or Claude is used in the app config.
3. **Call AI functions:**
   * `generateResponse` - **standard function** to get the entire AI response at once.
   * `streamResponse` - **streaming function** to receive incremental responses dynamically.
   * `generateImage` - generate 1024x1024 image and provides an URL
   * `estimateTokens` - returns estimate tokens count
   * `summarizeText` - summarizes given text
   * `moderateContent` - returns boolean whether the content is flagged as inappropriate

This adapter simplifies AI integration, making it easy to incorporate intelligent responses and conversational AI into your application.&#x20;


---

# 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://accelerator.gitbook.io/docs/setup/ai.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.
