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:
- First message: Send without
sessionId - Subsequent messages: Include the
sessionIdreturned 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
- 200
- 400
- 401
- 403
- 404
- 429
- 500
Successful inference response
Validation error - Invalid request format or missing required fields
Authentication error - Invalid or missing authorization token
Authorization error - User is not authorized to access this resource
Agent not found - The specified agent ID does not exist or is inactive
Rate limit exceeded
Internal server error