Skip to main content

Agent inference

POST 

/v1/agents/:agentId/inference

Execute inference using a specific agent without user authentication.

This is a public endpoint that allows direct interaction with AI agents using their access tokens.

Usage:

  1. First message: Send without sessionId
  2. Subsequent messages: Include the sessionId returned from the first response

Example cURL:

curl --location --request POST 'https://api.ko-ia.com/v1/agents/:agentId/inference' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_AGENT_TOKEN' \
--data '{
"message": "Olá! Como você pode me ajudar hoje?"
}'

Example with session:

curl --location --request POST 'https://api.ko-ia.com/v1/agents/:agentId/inference' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_AGENT_TOKEN' \
--data '{
"sessionId": "session_abc123def456",
"message": "Continue nossa conversa anterior"
}'

Request

Responses

Successful inference response