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
string
Server status (“ok” when running)
string
Agent initialization status (“ready” or “initializing”)
string
ISO 8601 timestamp of the response
number
Number of active chat sessions
Chat with Agent
Send a message to the Chat Agent and receive a response with optional unsigned transactions.string
required
User message to send to the agent
string
required
User’s wallet address (required for all operations)
string
Session ID to maintain conversation history. If not provided, a new session is created.
boolean
Whether the request was successful
string
Session ID for this conversation
string
Agent’s text response to the user
array
Full conversation history for this session
object
default:"null"
Unsigned transaction for the user to sign, if applicable
string
Current transaction step (“approval”, “deposit”, “withdrawal”, “info”)
Get Session History
Retrieve the full conversation history for a specific session.boolean
Whether the request was successful
string
Session ID
object
Session data
Reset Session
Clear the conversation history for a specific session.boolean
Whether the request was successful
string
Session ID that was reset
string
Confirmation message
Error Responses
All endpoints return error responses in the following format:string
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