# Agent Chat

Chat With Agents

## Starting agent chat

> Allows for communication with Emporix agents.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Agent Chat","description":"Chat With Agents"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.completion_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"ChatResponse":{"type":"object","properties":{"agentId":{"type":"string","description":"Unique identifier of the agent."},"agentType":{"$ref":"#/components/schemas/AgentType"},"sessionId":{"type":"string","description":"Unique identifier of the session."},"message":{"type":"string","description":"Agent message."}}},"AgentType":{"type":"string","description":"Type of the agent handling the request.","enum":["support","generic","complaint","anti_fraud"]},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"AgenticRequest":{"type":"object","properties":{"agentId":{"type":"string","description":"Unique identifier of the agent."},"message":{"type":"string","description":"The user message to the agent."}},"required":["agentId","message"]}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500_resp_common":{"description":"A server-side error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBodies":{"AgenticChat":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticRequest"}}}}}},"paths":{"/ai-service/{tenant}/agentic/chat":{"post":{"summary":"Starting agent chat","operationId":"POST-ai-agents-chat","responses":{"200":{"description":"Chat response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChatResponse"}}}}},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"},"500":{"$ref":"#/components/responses/500_resp_common"}},"description":"Allows for communication with Emporix agents.","requestBody":{"$ref":"#/components/requestBodies/AgenticChat"},"tags":["Agent Chat"]}}}}
```

## Starting agent async chat

> Allows for communication with Emporix agents in async way.

```json
{"openapi":"3.0.0","info":{"title":"AI Service","version":"0.0.1"},"tags":[{"name":"Agent Chat","description":"Chat With Agents"}],"servers":[{"url":"https://api.emporix.io"}],"security":[{"OAuth2":["ai.completion_manage"]}],"components":{"securitySchemes":{"OAuth2":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{"ai.text_manage":"Needed to execute actions related to the text generation.","ai.completion_manage":"Needed to execute actions related to the AI completions.","ai.agent_read":"Needed to read AI agents.","ai.agent_manage":"Needed to manage AI agents."},"tokenUrl":"https://api.emporix.io/oauth/token"}}}},"schemas":{"JobIdResponse":{"type":"object","properties":{"jobId":{"type":"string","description":"Identifier of the job."}}},"ErrorMessage":{"type":"object","properties":{"code":{"type":"integer"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"},"details":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"type":{"type":"string"},"message":{"type":"string"},"moreInfo":{"type":"string"}}}}},"description":""},"ErrorMessageFault":{"type":"object","properties":{"fault":{"type":"object","properties":{"faultstring":{"type":"string"},"detail":{"type":"object","properties":{"errorcode":{"type":"string"}}}}}}},"AgenticRequest":{"type":"object","properties":{"agentId":{"type":"string","description":"Unique identifier of the agent."},"message":{"type":"string","description":"The user message to the agent."}},"required":["agentId","message"]}},"responses":{"400_resp_common":{"description":"The request was syntactically incorrect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"401_resp_common":{"description":"The authorization token is invalid or has expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessageFault"}}}},"403_resp_common":{"description":"Authorization scopes of the access token are not sufficient and do not match the scopes required by the endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"500_resp_common":{"description":"A server-side error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"requestBodies":{"AgenticChat":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgenticRequest"}}}}}},"paths":{"/ai-service/{tenant}/agentic/chat-async":{"post":{"summary":"Starting agent async chat","operationId":"POST-ai-agents-chat-async","responses":{"201":{"description":"Job ID response.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobIdResponse"}}}}},"400":{"$ref":"#/components/responses/400_resp_common"},"401":{"$ref":"#/components/responses/401_resp_common"},"403":{"$ref":"#/components/responses/403_resp_common"},"500":{"$ref":"#/components/responses/500_resp_common"}},"description":"Allows for communication with Emporix agents in async way.","requestBody":{"$ref":"#/components/requestBodies/AgenticChat"},"tags":["Agent Chat"]}}}}
```
