Overview
The MetaVault AI Agent system exposes a REST API for interacting with the Chat Agent and Strategy Sentinel Agent. The API provides endpoints for chat interactions, session management, and health monitoring. Base URL:http://localhost:8080 (configurable via CHAT_PORT environment variable)
Authentication
No authentication is currently required. Wallet addresses are passed in request bodies to identify users.Endpoints
Health Check
Server status (“ok” when running)
Agent initialization status (“ready” or “initializing”)
ISO 8601 timestamp of the response
Number of active chat sessions
Chat with Agent
Send a message to the Chat Agent and receive a response with optional unsigned transactions.User message to send to the agent
User’s wallet address (required for all operations)
Session ID to maintain conversation history. If not provided, a new session is created.
Whether the request was successful
Session ID for this conversation
Agent’s text response to the user
Full conversation history for this session
Unsigned transaction for the user to sign, if applicable
Current transaction step (“approval”, “deposit”, “withdrawal”, “info”)
Get Session History
Retrieve the full conversation history for a specific session.Whether the request was successful
Session ID
Session data
Reset Session
Clear the conversation history for a specific session.Whether the request was successful
Session ID that was reset
Confirmation message
Error Responses
All endpoints return error responses in the following format:Error message describing what went wrong
400- Bad request (missing required parameters)404- Session not found500- Internal server error (agent failure)
Session Management
- Sessions are stored in-memory and will be lost on server restart
- Each session maintains its own conversation history
- Session IDs can be any string (typically timestamps or UUIDs)
- Sessions are created automatically when a new session ID is used