OpenResponses HTTP API
OpenResponses API 提供响应式消息发送接口。
端点
POST /v1/responses
GET /v1/responses/{id}
DELETE /v1/responses/{id}发送响应
bash
curl -X POST http://localhost:8211/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GATEWAY_TOKEN}" \
-d '{
"channel": "whatsapp",
"recipient": "+1234567890",
"content": {
"type": "text",
"text": "Hello from OpenClaw!"
}
}'响应格式
json
{
"id": "resp_abc123",
"status": "sent",
"channel": "whatsapp",
"recipient": "+1234567890",
"timestamp": "2024-01-15T10:30:00Z",
"delivery_status": {
"status": "delivered",
"at": "2024-01-15T10:30:01Z"
}
}批量发送
bash
curl -X POST http://localhost:8211/v1/responses/batch \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${GATEWAY_TOKEN}" \
-d '{
"channel": "whatsapp",
"recipients": ["+1234567890", "+0987654321"],
"content": {
"type": "text",
"text": "Hello everyone!"
}
}'配置选项
yaml
gateway:
openresponses_api:
enabled: true
path: "/v1"
batch:
max_size: 100
rate_limit: 50
delivery_tracking: true相关概念
- OpenAI HTTP API - OpenAI 兼容 API
- 消息处理 - 消息发送