# Assistant API Integration

<figure><img src="https://4173380749-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzKzxNnOaGxZvAEzvYa7y%2Fuploads%2Fzqlp2AlRb4b2yeGyH1Zs%2FScreen%20Shot%202567-07-16%20at%2019.28.41.png?alt=media&#x26;token=ffd4a4f6-add8-4632-95b5-131840c01849" alt=""><figcaption><p>Assistant API Tab</p></figcaption></figure>

The system will display the Secret Key for the assistant, which you will need for authorization with the BOTs+ Messaging API. You can select your preferred language and add the provided code to your project.

## Message Streaming

Enhance the messaging API to support streaming answers. *(This feature is currently available only via the API.)*

### Request Body

* Add 'stream' as a boolean, set TRUE to enable streaming

```
{
  ...,
  "stream": true
}
```

### Response Body

Here's the example of response body

```
/// completion in progress
data: {"__status": "active", "content": "Hello"}
data: {"__status": "active", "content": "Hello! How may"}

// once processing has finished
data: {"__status": "finished", "answer": "Hello! How may I help you?" , "inspection": {...}, searchResults: {...}}

// if there are any errors
data: {"__error", "name": "SampleException", "code": 400000, "status": 400, "message": "error message", "errors": []}
```
