Complete API reference for the HAIP Server
config
- Configuration object (optional)tool
- Tool definition objecttoolName
- Name of the tool to removesessionId
- Session identifiermessage
- HAIP message to broadcastsessionId
- Target session IDmessage
- HAIP message to sendsessionId
- Target session IDcallId
- Tool call identifierstatus
- Completion status (‘OK’, ‘ERROR’, ‘CANCELLED’)result
- Tool result (optional)GET /health
Response:
GET /stats
Response:
ws://localhost:8080/haip/websocket?token=<jwt-token>
Parameters:
token
- JWT authentication token (required)GET /haip/sse?token=<jwt-token>
Parameters:
token
- JWT authentication token (required)POST /haip/stream
Headers:
Authorization: Bearer <jwt-token>
(required)Content-Type: application/json
INVALID_TOKEN
- JWT token is invalid or expiredMISSING_TOKEN
- JWT token is required but not providedINVALID_MESSAGE
- Message format is invalidUNSUPPORTED_TYPE
- Message type is not supportedTOOL_NOT_FOUND
- Requested tool does not existTOOL_EXECUTION_ERROR
- Tool execution failedINSUFFICIENT_CREDITS
- Not enough credits for the channelCHANNEL_PAUSED
- Channel is pausedMISSING_RUN_ID
- Run ID is required but not providedRUN_NOT_FOUND
- Run does not existMAX_RUNS_EXCEEDED
- Maximum concurrent runs exceededJWT_SECRET
- Secret key for JWT token signingPORT
- Server port (default: 8080)HOST
- Server host (default: 0.0.0.0)NODE_ENV
- Environment (development/production)JWT_EXPIRES_IN
- JWT expiration time (default: 24h)MAX_CONNECTIONS
- Maximum connections (default: 1000)HEARTBEAT_INTERVAL
- Heartbeat interval in ms (default: 30000)HEARTBEAT_TIMEOUT
- Heartbeat timeout in ms (default: 5000)ENABLE_CORS
- Enable CORS (default: true)ENABLE_COMPRESSION
- Enable compression (default: true)ENABLE_LOGGING
- Enable logging (default: true)FLOW_CONTROL_ENABLED
- Enable flow control (default: true)FLOW_CONTROL_INITIAL_CREDITS
- Initial credits (default: 1000)FLOW_CONTROL_MIN_CREDITS
- Minimum credits (default: 100)FLOW_CONTROL_MAX_CREDITS
- Maximum credits (default: 10000)FLOW_CONTROL_CREDIT_THRESHOLD
- Credit threshold (default: 200)FLOW_CONTROL_BACK_PRESSURE_THRESHOLD
- Back-pressure threshold (default: 0.8)FLOW_CONTROL_ADAPTIVE_ADJUSTMENT
- Adaptive adjustment (default: true)FLOW_CONTROL_INITIAL_CREDIT_MESSAGES
- Initial message credits (default: 1000)FLOW_CONTROL_INITIAL_CREDIT_BYTES
- Initial byte credits (default: 1048576)