> For the complete documentation index, see [llms.txt](https://docs.amitysolutions.com/amity-solutions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amitysolutions.com/amity-solutions/amity-bots-gen-ai-platform/assistants/assistant-api-integration.md).

# Assistant API Integration

<figure><img src="/files/o4cuOAgHkgmXHrfbGc9A" 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": []}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.amitysolutions.com/amity-solutions/amity-bots-gen-ai-platform/assistants/assistant-api-integration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
