Executar agente
Executar agente. Consulte abaixo parâmetros, corpo da requisição e respostas definidos no contrato OpenAPI.
/Agent/runExecutar agente. Consulte abaixo parâmetros, corpo da requisição e respostas definidos no contrato OpenAPI.
Descrição no OpenAPI: This endpoint runs the agent with the provided input message.
Autenticação
Autenticação obrigatória. Envie sua chave de API de usuário no header X-API-Key.
Parâmetros
Esta operação não possui parâmetros de rota, query ou header.
Corpo da requisição
Content type: multipart/form-data · Schema: object
| Propriedade | Tipo | Obrigatório | Descrição | Restrições |
|---|---|---|---|---|
file | string · binary | Não | — | — |
AgentId | integer · int32 | Não | — | — |
ConversationId | integer · int32 | Não | — | — |
UserInputMessage | string | Não | — | — |
MessageType | MessageType | Não | — | — |
ProgressRunId | string | Não | — | — |
DocumentId | integer · int32 | Não | — | — |
Exemplo de requisição
curl --request POST \
--url 'https://api.zild.ai/Agent/run' \
--header 'X-API-Key: YOUR_USER_API_KEY' \
--form 'file=@file' \
--form 'AgentId={AgentId}' \
--form 'ConversationId={ConversationId}' \
--form 'UserInputMessage={UserInputMessage}' \
--form 'MessageType={MessageType}' \
--form 'ProgressRunId={ProgressRunId}' \
--form 'DocumentId={DocumentId}'
Respostas
| Status | Descrição | Corpo da resposta |
|---|---|---|
200 | Execution completed successfully | application/json · AgentRunTextResponseDto |
Exemplo de resposta (200):
{
"model": "string",
"agentAIType": 0,
"modelPolicyId": 0,
"modelPolicyVersion": 0,
"fallbackUsed": true,
"modelAttempts": [
{
"provider": 0,
"model": "string",
"succeeded": true,
"failureReason": "string",
"durationMilliseconds": 0,
"usage": {
"inputTokens": 0,
"outputTokens": 0,
"totalTokens": 0,
"cachedInputTokens": 0,
"reasoningTokens": 0
}
}
],
"quotaExceeded": true,
"conversationId": 0,
"title": "string",
"userMessageId": 0,
"attachmentMessageId": 0,
"assistantMessageId": 0,
"reply": "string"
}
Modelos de dados
AgentAIType
0 = AzureOpenAI; 1 = OpenAI; 2 = RetellAI; 3 = ElevenLabs; 4 = Lovable; 5 = n8n; 6 = Aws; 7 = MicrosoftCopilot; 8 = GoogleGemini; 9 = AnthropicClaude; 10 = Alteryx
integer
AgentModelCallAttempt
| Propriedade | Tipo | Obrigatório | Descrição | Restrições |
|---|---|---|---|---|
provider | AgentAIType | Não | — | — |
model | string | Não | — | aceita null |
succeeded | boolean | Não | — | — |
failureReason | string | Não | — | aceita null |
durationMilliseconds | integer · int64 | Não | — | — |
usage | AgentRunUsage | Não | — | — |
AgentRunTextResponseDto
| Propriedade | Tipo | Obrigatório | Descrição | Restrições |
|---|---|---|---|---|
model | string | Não | — | aceita null |
agentAIType | AgentAIType | Não | — | — |
modelPolicyId | integer · int32 | Não | — | aceita null |
modelPolicyVersion | integer · int32 | Não | — | aceita null |
fallbackUsed | boolean | Não | — | — |
modelAttempts | array<AgentModelCallAttempt> | Não | — | aceita null |
quotaExceeded | boolean | Não | — | — |
conversationId | integer · int32 | Não | — | — |
title | string | Não | Conversation title generated by the agent after the first chat interaction. Falls back to Nova conversa if generation fails or its quota is exhausted. Existing conversations are not backfilled. | aceita null |
userMessageId | integer · int32 | Não | — | — |
attachmentMessageId | integer · int32 | Não | — | aceita null |
assistantMessageId | integer · int32 | Não | — | — |
reply | string | Não | — | aceita null |
AgentRunUsage
| Propriedade | Tipo | Obrigatório | Descrição | Restrições |
|---|---|---|---|---|
inputTokens | integer · int32 | Não | — | — |
outputTokens | integer · int32 | Não | — | — |
totalTokens | integer · int32 | Não | — | — |
cachedInputTokens | integer · int32 | Não | — | — |
reasoningTokens | integer · int32 | Não | — | — |
MessageType
0 = Text; 1 = Image; 2 = File; 3 = Audio; 4 = Video; 5 = Internal; 6 = TemplateMarketing; 7 = TemplateUtility; 8 = Location; 9 = Contact
integer