POST /api/v1/chat#
Send a message to an agent and receive a response.
Request#
Headers#
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer hmt_your_key | Yes |
| Content-Type | application/json | Yes |
Body Parameters#
| Field | Type | Required | Description |
|---|---|---|---|
| agent_id | string | Yes | The agent to send the message to |
| message | string | Yes | The user message content |
| conversation_id | string | No | Continue an existing conversation |
Example#
bash
curl -X POST https://humuter.com/api/v1/chat \
-H "Authorization: Bearer hmt_your_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "ag_abc123",
"message": "What are your business hours?",
"conversation_id": "conv_xyz789"
}'Response#
json
{
"id": "msg_def456",
"conversation_id": "conv_xyz789",
"agent_id": "ag_abc123",
"role": "assistant",
"content": "Our business hours are Monday through Friday, 9 AM to 5 PM EST.",
"created_at": "2026-03-04T12:00:00Z",
"credits_used": 1
}Errors#
| Code | Reason |
|---|---|
| 400 | Missing agent_id or message |
| 401 | Invalid or missing API key |
| 402 | Insufficient credits |
| 404 | Agent not found |
| 429 | Rate limit exceeded |
Use
conversation_id to maintain context across multiple messages in the same conversation.