Agent Chat
In-app AI chat agent — conversations, streaming, models, preferences, and feedback
The Agent API powers Vezta's in-app AI chat assistant. Responses stream over Server-Sent Events (SSE); conversations are persisted per user. The agent exposes read-only market and portfolio tools plus a market_intel skill. All endpoints attribute the turn to the authenticated caller via a Bearer access token (the SSE chat and transcribe routes read the token from the request even though they bypass the global guard).
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /api/v1/agent/chat | Bearer | Send a message to the agent (SSE response stream) |
| POST | /api/v1/agent/chat/resume | Bearer | Resume a paused stream after Confirm/Cancel on a confirm card |
| GET | /api/v1/agent/chat/:requestId/stream | Bearer | Reconnect to an in-flight agent turn (SSE) |
| GET | /api/v1/agent/models | Bearer | List models available to the caller |
| GET | /api/v1/agent/conversations | Bearer | List the caller's conversations |
| DELETE | /api/v1/agent/conversations | Bearer | Delete all conversations |
| GET | /api/v1/agent/conversations/:id/messages | Bearer | List messages in a conversation |
| GET | /api/v1/agent/conversations/:id/export | Bearer | Export a conversation as markdown |
| PATCH | /api/v1/agent/conversations/:id | Bearer | Rename a conversation |
| DELETE | /api/v1/agent/conversations/:id | Bearer | Delete a conversation |
| POST | /api/v1/agent/messages/:id/feedback | Bearer | Record thumbs up/down feedback on a message |
| GET | /api/v1/agent/preferences | Bearer | List the caller's saved agent preferences |
| DELETE | /api/v1/agent/preferences/:id | Bearer | Delete one saved preference |
| DELETE | /api/v1/agent/preferences | Bearer | Delete all saved preferences |
| POST | /api/v1/agent/transcribe | Bearer | Transcribe audio to text (Whisper) |
Streaming
POST /api/v1/agent/chat responds with an SSE stream (text/event-stream) of token deltas, tool-call events, and result cards. If the connection drops mid-turn, reconnect with GET /api/v1/agent/chat/:requestId/stream using the requestId from the initial response. When the agent emits a confirm card, the stream pauses; call POST /api/v1/agent/chat/resume with the user's decision to continue.
Notes
- Conversations and messages are scoped to the authenticated user.
POST /api/v1/agent/messages/:id/feedbackaccepts a thumbs signal used to improve responses.