# Agents

Executa agentes de texto e multimodal, incluindo WebChat e canais conectados.

## POST /api/v3/agent\_voice

> Gerar áudio TTS para um agente

```json
{"openapi":"3.0.3","info":{"title":"Genier API v3","version":"3.12.0"},"tags":[{"name":"Agents","description":"Executa agentes de texto e multimodal, incluindo WebChat e canais conectados."}],"servers":[{"url":"https://{host}/{tenant}","description":"Define o host e o tenant usados nas chamadas.","variables":{"host":{"default":"app.genier.ai"},"tenant":{"default":"my-tenant"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"AgentVoiceRequest":{"type":"object","required":["text","agent_id","slug"],"properties":{"text":{"type":"string","description":"Texto a sintetizar"},"agent_id":{"type":"string","description":"ID do agente (aceita \"agent_<uuid>\" ou apenas \"<uuid>\")"},"slug":{"type":"string","description":"Nome do arquivo de saída (será salvo como .mp3)"}}},"AgentVoiceResponse":{"type":"object","properties":{"result":{"type":"string"},"message":{"type":"string"},"public_url":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v3/agent_voice":{"post":{"summary":"Gerar áudio TTS para um agente","tags":["Agents"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVoiceRequest"}}}},"responses":{"200":{"description":"Retorna metadados do áudio TTS gerado para o agente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVoiceResponse"}}}},"400":{"description":"Rejeita a requisição quando faltam campos obrigatórios ou a configuração de TTS não está disponível.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Falha de autenticação da chave de API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Não encontra o agente informado ou a configuração de TTS do tenant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Falha interna ao gerar o áudio.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v3/agent/{agent\_id}

> Executar agente (texto) com histórico

```json
{"openapi":"3.0.3","info":{"title":"Genier API v3","version":"3.12.0"},"tags":[{"name":"Agents","description":"Executa agentes de texto e multimodal, incluindo WebChat e canais conectados."}],"servers":[{"url":"https://{host}/{tenant}","description":"Define o host e o tenant usados nas chamadas.","variables":{"host":{"default":"app.genier.ai"},"tenant":{"default":"my-tenant"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"AgentRequest":{"type":"object","required":["query","history"],"properties":{"query":{"type":"string","description":"Pergunta do usuário"},"history":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"tts":{"type":"boolean","default":false},"user_prompt":{"type":"string","description":"Instruções adicionais para o agente"},"voice_priority":{"type":"boolean","default":false},"ask_human":{"type":"boolean","default":false}}},"HistoryItem":{"type":"object","properties":{"input":{"type":"string"},"output":{"type":"string"},"role":{"type":"string","description":"Papel opcional no diálogo"}}},"AgentResponseData":{"type":"object","properties":{"status":{"type":"integer"},"history":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"response":{"type":"string"},"entity":{"type":"boolean"},"entity_content":{"type":"object"},"tts_audio_mp3_encoded_base64":{"type":"string"},"file_encoded_base64":{"type":"string"},"session_id":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v3/agent/{agent_id}":{"post":{"summary":"Executar agente (texto) com histórico","tags":["Agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID do agente (ex.: agent_1234abcd)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRequest"}}}},"responses":{"200":{"description":"Retorna a resposta do agente e o histórico atualizado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponseData"}}}},"400":{"description":"Rejeita quando parâmetros obrigatórios estão ausentes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Falha de autenticação da chave de API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v3/agent\_mm/{agent\_id}

> Executar agente multimodal (texto, áudio, OCR, upload)

```json
{"openapi":"3.0.3","info":{"title":"Genier API v3","version":"3.12.0"},"tags":[{"name":"Agents","description":"Executa agentes de texto e multimodal, incluindo WebChat e canais conectados."}],"servers":[{"url":"https://{host}/{tenant}","description":"Define o host e o tenant usados nas chamadas.","variables":{"host":{"default":"app.genier.ai"},"tenant":{"default":"my-tenant"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"AgentMMJsonRequest":{"type":"object","required":["history","text"],"properties":{"history":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"text":{"type":"string","description":"Texto a ser processado (quando não usar arquivos)"},"tts":{"type":"boolean","default":false},"hashtag":{"type":"boolean","default":false,"description":"Se true, remove e retorna hashtags encontradas"},"ask_human":{"type":"boolean","default":false},"user_prompt":{"type":"string"},"voice_priority":{"type":"boolean","default":false},"session_id":{"type":"string","format":"uuid"}}},"HistoryItem":{"type":"object","properties":{"input":{"type":"string"},"output":{"type":"string"},"role":{"type":"string","description":"Papel opcional no diálogo"}}},"AgentMMFormRequest":{"type":"object","required":["history"],"properties":{"history":{"type":"string","description":"JSON serializado do histórico (obrigatório)"},"text":{"type":"string"},"audio":{"type":"string","format":"binary"},"ocr":{"type":"string","format":"binary"},"files":{"type":"array","items":{"type":"string","format":"binary"}},"tts":{"type":"string","description":"Booleano em string (\"true\"/\"false\")"},"hashtag":{"type":"string","description":"Booleano em string (\"true\"/\"false\")"},"ask_human":{"type":"string","description":"Booleano em string (\"true\"/\"false\")"},"user_prompt":{"type":"string"},"voice_priority":{"type":"string","description":"Booleano em string (\"true\"/\"false\")"},"session_id":{"type":"string","description":"UUID opcional"}}},"AgentResponseData":{"type":"object","properties":{"status":{"type":"integer"},"history":{"type":"array","items":{"$ref":"#/components/schemas/HistoryItem"}},"response":{"type":"string"},"entity":{"type":"boolean"},"entity_content":{"type":"object"},"tts_audio_mp3_encoded_base64":{"type":"string"},"file_encoded_base64":{"type":"string"},"session_id":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v3/agent_mm/{agent_id}":{"post":{"summary":"Executar agente multimodal (texto, áudio, OCR, upload)","tags":["Agents"],"parameters":[{"name":"agent_id","in":"path","required":true,"schema":{"type":"string"},"description":"ID do agente (ex.: agent_1234abcd)"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMMJsonRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AgentMMFormRequest"}}}},"responses":{"200":{"description":"Retorna a resposta multimodal do agente e os artefatos processados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponseData"}}}},"400":{"description":"Rejeita quando faltam parâmetros obrigatórios ou o conteúdo enviado é inválido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Falha de autenticação da chave de API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Bloqueia conteúdos não suportados pelo modo configurado do agente.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Recusa arquivos acima do limite permitido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"415":{"description":"Recusa tipos de arquivo não suportados.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Falha interna ao processar o conteúdo enviado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v3/agent\_list

> Listar agentes disponíveis

```json
{"openapi":"3.0.3","info":{"title":"Genier API v3","version":"3.12.0"},"tags":[{"name":"Agents","description":"Executa agentes de texto e multimodal, incluindo WebChat e canais conectados."}],"servers":[{"url":"https://{host}/{tenant}","description":"Define o host e o tenant usados nas chamadas.","variables":{"host":{"default":"app.genier.ai"},"tenant":{"default":"my-tenant"}}}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"AgentListItem":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v3/agent_list":{"get":{"summary":"Listar agentes disponíveis","tags":["Agents"],"responses":{"200":{"description":"Retorna a lista de agentes disponíveis para o tenant.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentListItem"}}}}},"401":{"description":"Falha de autenticação da chave de API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.fortics.com.br/ai-api-reference/reference/agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
