Send Message
Send a message to an agent and receive a response.
Endpoint
POST https://api.irisos.xyz/v1/agents/{agentId}/messagesAuthentication
This endpoint requires an API key. Include it in the request headers:
Authorization: Bearer YOUR_API_KEYPath Parameters
agentId
string
Yes
The unique identifier of the agent
Request Body
text
string
Yes
The message text to send to the agent
userId
string
No
Unique identifier for the user (for conversation continuity)
roomId
string
No
Conversation room ID (for multi-user conversations)
context
object
No
Additional context for the conversation
stream
boolean
No
Enable streaming response (default: false)
Example Request Body
Response
Success Response (200 OK)
Error Response (400 Bad Request)
Error Response (404 Not Found)
Error Response (503 Service Unavailable)
Example Request
cURL
JavaScript
Python
Streaming Responses
For real-time responses, enable streaming mode:
JavaScript with Streaming
Conversation Context
The agent maintains conversation context using userId and roomId:
Rate Limits
Rate Limit: 60 requests per minute per agent
Concurrent Requests: 10 simultaneous requests per agent
Rate limit headers are included in the response:
X-RateLimit-Limit: Maximum requests per minuteX-RateLimit-Remaining: Remaining requestsX-RateLimit-Reset: Reset timestamp
Best Practices
Use userId consistently: Always send the same userId for the same user to maintain context
Handle rate limits: Implement exponential backoff for rate limit errors
Set timeouts: Configure appropriate request timeouts (30s recommended)
Stream long responses: Use streaming for responses that may be lengthy
Validate input: Sanitize user input before sending to the agent
Related Endpoints
Last updated