> ## Documentation Index
> Fetch the complete documentation index at: https://help.soundverse.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Chat Assistant

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## 💬 Real-Time AI Chat & Response Generation

Use this API to interact with our AI assistant in real time. Simply provide your `userId` and `prompt` to receive a generated response.

***

#### **Core Parameters**

> 🛈 The parameters below define the request body for this API.

| Parameter    | Type     | Required?  | Description                                   |
| ------------ | -------- | ---------- | --------------------------------------------- |
| **`prompt`** | `string` | ✅ Required |    User's input or query to the AI assistant. |
| **`action`** | `string` | ✅ Required |    AIMagicTool AI assistant.                  |

***

#### AIMagicTool (action)

```
{
    "generate_music": For Prompts related to Generating text to music,
    "extend_music": Conversation related to Extending the song,
    "auto_complete_music": Conversation related to auto-complting the song,
    "loop_audio": loop_audio,
    "separate_stems": For stem separtion related Conversation,
    "edit_music": Conversation related to editing the music,
    "lyric_writing": Conversation related to generating lyrics,
    "other": Any other normal Conversation,
}
```

#### **Request Body**

<div style={{ backgroundColor: "#e9ecef", padding: "0.75rem", borderRadius: "0.3rem" }}>
  ```json theme={null}
  {
    "prompt": "str",
    "action": "str"
  }
  ```
</div>

#### Code Samples

<Tabs>
  <Tab title="Python">
    ```python theme={null}
      import requests

      url = "https://api.soundverse.ai/assistant/chat"
      headers = {
          "Authorization": "Bearer your_api_key_here",
          "Content-Type": "application/json"
      }
      payload = {
          "prompt" : "I want to make a chill lo-fi beat. What should the mood and tempo be?",
          "action" : "other"
      }

      response = requests.post(url, json=payload, headers=headers)
      print(response.json())

    ```
  </Tab>

  <Tab title="cURL">
    ```sh theme={null}
      curl -X POST "https://api.soundverse.ai/generate/extend" \
      -H "Authorization: Bearer your_api_key_here" \
      -H "Content-Type: application/json" \
      -d '{
      "prompt": "I want to make a chill lo-fi beat. What should the mood and tempo be?""
      "action" : "other"
      }'

    ```
  </Tab>
</Tabs>

#### Response

<Tabs>
  <Tab title="200 OK">
    ```sh theme={null}
      {
      "aiReply": "str",
      }
    ```
  </Tab>
</Tabs>

#### Possible Errors :

* Internal Server Error -
  `500 status code `
