> For the complete documentation index, see [llms.txt](https://docs.chatcaptain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chatcaptain.com/api/api-dokumentation/inbox-ai-chat-functions.md).

# Inbox ai Chat Functions

## Generates an AI-based summary of the conversation

> \
> \
> \*\*Required Permission:\*\* \`chatbots.inbox.openai.summary\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Inbox ai-chat-functions","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/inbox/{chatbotId}/conversations/{conversationId}/summary":{"get":{"operationId":"InboxAiChatController_createChatSummary[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"conversationId","required":true,"in":"path","description":"The ID of the conversation.","schema":{"type":"string"}}],"responses":{"200":{"description":"The generated summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatSummaryResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Generates an AI-based summary of the conversation","tags":["Inbox ai-chat-functions"],"description":"\n\n**Required Permission:** `chatbots.inbox.openai.summary`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"CreateChatSummaryResponseDto":{"type":"object","properties":{"summary":{"type":"string","description":"The generated summary of the conversation."},"error":{"type":"string","description":"Optional error message."}},"required":["summary"]}}}}
```

## Generates a text completion for an agent's response

> \
> \
> \*\*Required Permission:\*\* \`chatbots.inbox.openai.completion\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Inbox ai-chat-functions","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/inbox/{chatbotId}/conversations/{conversationId}/completion":{"get":{"operationId":"InboxAiChatController_createChatCompletion[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"conversationId","required":true,"in":"path","description":"The ID of the conversation.","schema":{"type":"string"}}],"responses":{"200":{"description":"The generated text completion.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatCompletionResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Generates a text completion for an agent's response","tags":["Inbox ai-chat-functions"],"description":"\n\n**Required Permission:** `chatbots.inbox.openai.completion`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"CreateChatCompletionResponseDto":{"type":"object","properties":{"completion":{"type":"string","description":"The completed text suggestion."},"error":{"type":"string","description":"Optional error message."}},"required":["completion"]}}}}
```

## Reformulates a given message using AI

> \
> \
> \*\*Required Permission:\*\* \`chatbots.inbox.openai.formulation\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Inbox ai-chat-functions","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/inbox/{chatbotId}/conversations/{conversationId}/formulation":{"post":{"operationId":"InboxAiChatController_createChatFormulation[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"conversationId","required":true,"in":"path","description":"The ID of the conversation.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatFormulationRequestDto"}}}},"responses":{"201":{"description":"The reformulated message.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChatFormulationResponseDto"}}}},"400":{"description":"Invalid input data."},"403":{"description":"Insufficient permissions."}},"summary":"Reformulates a given message using AI","tags":["Inbox ai-chat-functions"],"description":"\n\n**Required Permission:** `chatbots.inbox.openai.formulation`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"CreateChatFormulationRequestDto":{"type":"object","properties":{"message":{"type":"string","description":"The message to be reformulated."}},"required":["message"]},"CreateChatFormulationResponseDto":{"type":"object","properties":{"formulation":{"type":"string","description":"The reformulated text suggestion."}}}}}}
```


---

# 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.chatcaptain.com/api/api-dokumentation/inbox-ai-chat-functions.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.
